开发者

If false, search both true and false in Access sql

SELECT id
FROM Activity
WHERE important = see below

IF [Forms]![Search]![important] = false, search for both true and false

IF [Forms]![Search]![important] = true, search for only tru开发者_如何学运维e

I hope you understand what I want to do. Is this possible?


Try this:

SELECT id
FROM Activity
WHERE important = @important OR @important = false

Or, maybe (just like ammoQ said)

SELECT id
FROM Activity
WHERE important OR NOT [Forms]![Search]![important]


Probably the shortest form, though not very readable:

SELECT id
FROM Activity
WHERE important OR NOT @important
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜