使用“是空的”作为基于表单的标准 [英] Using "Is Null" as a criteria based on a form
问题描述
我试图让我的查询只在表单上的一个单选框被选中时才返回空记录。如果我在查询中手动包含条件Is Null,那么它的工作原理就很好,并且在其他地方像
IIf([Forms]! [Reports]![Status - Active] = True,Active)
工作得很好。 / p>
但是,
IIf([Forms]![Reports]! [Status - Null] = True,Is Null)
忽略它(我假设它是实际上寻找文本是空的而不是空记录)和
IIf([Forms]![Reports]![状态 - 空] =真,为空)
失败,因为它太复杂。有什么方法可以实现我想要实现的目标?
谢谢。
$ b
SELECT t.atext $ b $您可以通过几种方式解决问题。 b FROM Table1 t
WHERE IsNull([atext])= [Forms]![Reports]![Status - Null]
BTW,立即如果(IIf)有三个参数。
I'm trying to get my query to only return null records if a radio box on a form is ticked. If I manually include the criteria Is Null in the query it works just fine, and elsewhere things like
IIf([Forms]![Reports]![Status - Active]=True,"Active")
work just fine.
However,
IIf([Forms]![Reports]![Status - Null]=True,"Is Null")
just ignores it (I assume because it's actually looking for the text "Is Null" rather than null records) and
IIf([Forms]![Reports]![Status - Null]=True,Is Null)
fails because it's too complex. Is there any way of achieving what I'm trying to achieve?
Thanks.
You could work around in a couple of ways, for example.
SELECT t.atext
FROM Table1 t
WHERE IsNull([atext])=[Forms]![Reports]![Status - Null]
BTW, Immediate If (IIf) takes three arguments.
这篇关于使用“是空的”作为基于表单的标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!