【发布时间】:2014-03-13 13:32:49
【问题描述】:
我在使用NOT LIKE 时遇到问题。据我所知,这是正确的语法,但是,查询仍然返回[H1 Full Name] = SPEC 的记录。任何想法为什么会这样?
SELECT [Unit Owner Listing].[Unit#],
[Unit Owner Listing].[Combined Name],
[Unit Owner Listing].Address,
[Unit Owner Listing].[Home Phone],
[Unit Owner Listing].[H1 Cell Phone],
[Unit Owner Listing].[H1 E-Mail],
[Unit Owner Listing].[H2 Cell Phone],
[Unit Owner Listing].[H2 E-Mail],
[Unit Owner Listing].[H1 Last Name] & ', ' & [Unit Owner Listing].[H1 First Name] AS [H1 Full Name],
IIF([Unit Owner Listing].[H2 Last Name] IS NOT NULL,
[Unit Owner Listing].[H2 Last Name] & ', ' & [Unit Owner Listing].[H2 First Name],
NULL) AS [H2 Full Name]
FROM [Unit Owner Listing]
WHERE (
(([Unit Owner Listing].[H1 Last Name])<>"")
OR
(([Unit Owner Listing].[H1 Last Name]) Not Like "*SPEC*")
OR
(([Unit Owner Listing].[H1 Last Name]) Not Like "*MODEL*")
)
ORDER BY [Unit Owner Listing].[H1 Last Name];
【问题讨论】:
标签: sql ms-access ms-access-2013