IIF statement as criteria

R

rrt4703

I am trying to write a query that filters out all February 29th from a
set of start and stop dates passed to the query from a form. There is
also a check box to include or exclude the February 29th from the
query. This is what I have so far.

IIf([forms]![frm_individual_member]![check26]=True,Not 229,"*")

I just cant get it to pass the info into the criteria. Any help would
be greatly appreciated.

Thanks
 
D

Douglas J. Steele

You cannot change the comparison being done in a query through an IIf
statement.

You need to write something like:

WHERE Format([TheDateField], "mmdd") = "0229"
AND Nz(Forms![frm_individual_member]![check26], False) = True
 
R

rrt4703

You cannot change the comparison being done in a query through an IIf
statement.

You need to write something like:

WHERE Format([TheDateField], "mmdd") = "0229"
AND Nz(Forms![frm_individual_member]![check26], False) = True

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)


I am trying to write a query that filters out all February 29th from a
set of start and stop dates passed to the query from a form.  There is
also a check box to include or exclude the February 29th from the
query.  This is what I have so far.
IIf([forms]![frm_individual_member]![check26]=True,Not 229,"*")
I just cant get it to pass the info into the criteria.  Any help would
be greatly appreciated.

Thanks it worked great. I can see I still have a lot to learn about
ACESS.
 

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