Selecting all values in IIF statement

Giganews Newsgroups
Subject: Selecting all values in IIF statement
Posted by:  Harris Steinman (harrissteinm…@gmail.com)
Date: Wed, 1 Apr 2020

Hi, hope someone can advise.

I have a boolean field that has values that are either 0 or -1

I want to construct a query, that if a control is not ticked, only the value 0 is selected, but if ticked, it will select BOTH 0 AND -1 (all records).

I have tried a number of options, including

IIf([NoNewsletter]=0,0,Like "*")
IIf([NoNewsletter]=0,0,[NoNewsletter])

but simply cannot get this to work

In the first example, if value inputted is 0, all the 0 value records are displayed. If the value inputted is anything but 0, then only the records with -1 are displayed.

Any help?

Replies