开发者

If false, search both true and false in Access sql

开发者 https://www.devze.com 2022-12-13 15:41 出处:网络
SELECT id FROM Activity WHERE important = see below IF [Forms]![Search]![important] = false, search for both true and false
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

精彩评论

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