Include/Exclude Nulls in Query Output

P

Pete

I have a query that includes a date field in its output. I have a check box
on a form where the user can choose whether to include blank (null) dates or
not in the output. If they tick the box nulls should be included. However I
cannot get the following criteria expression to work.

IIf([Forms]![myForm]!![chkBlank]=0,Is Not Null,True)
 
M

mscertified

The basic syntax of IIF is:
IIF(condition,<return value if true>,<return value if false>)

so you need something like:
IIf([Forms]![myForm]!![chkBlank]=0,0,1)
which will return 0 if true and 1 if false
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top