此Access查询有什么问题。我没有错误,但没有记录:
有许多记录(似乎)符合标准。
SELECT Members.[Last Name], Members.[First Name], Members.Address, Members.City, Members.State, Members.Zip, Members.[E-Mail]
FROM Members
WHERE (((Members.Inactive)=Yes) AND ((Members.Deceased)<>Yes) AND (IsEmpty(Members.[E-Mail])=Yes))
ORDER BY Members.[Last Name], Members.[First Name];
答案 0 :(得分:2)
IsEmpty(Members.[E-Mail])
将为每一行返回False。
如果您希望条件选择E-Mail
为空的行,请使用IsNull([E-Mail])
或[E-Mail] Is Null
如果您希望条件选择E-Mail
为零长度字符串的行,请使用Len([E-Mail]) = 0
如果您希望条件选择E-Mail
为空或零长度字符串的行,请使用Len([E-Mail] & '') = 0
答案 1 :(得分:0)
是否要将Members.Inactive
,Members.Deceased
等与变量Yes
或字符串"Yes"
匹配?如果是后者,则需要替换:
WHERE
(((Members.Inactive)=Yes)
AND
((Members.Deceased)<>Yes)
AND
(IsEmpty(Members.[E-Mail])=Yes))
使用:
WHERE
(((Members.Inactive)="Yes")
AND
((Members.Deceased)<>"Yes")
AND
(IsEmpty(Members.[E-Mail])="Yes"))