two conditions in IIF statement?

  • Thread starter quaddawg via AccessMonster.com
  • Start date
Q

quaddawg via AccessMonster.com

In a query, I've created a calculated field called "Inactive" that reads:

IIf(FORMAT(ThirdRenewal,"yyyymm")<FORMAT(DATE(),"yyyymm"),"Inactive") AS
Inactive.

It's the control for a text box on a form visually notifying whether a
membership has lapsed. This works except that it displays "Inactive" for
Null values. (I'm working with old data, and I'm assuming the blanks are
Nulls and not zero strings. Perhaps I shouldn't?).
Is there a way to compile Boolean statements within IIf functions? For
example, could I combine the criteria above with *And* Not IsNull? Do I need
to be using Nz? If so, how?

Thanks for your help.
 
J

Jeff L

IIf(FORMAT(ThirdRenewal,"yyyymm")<FORMAT(DATE(),"yyyymm") And Not
ISNull(ThirdRenewal),"Inactive") AS
Inactive.
 
Q

quaddawg via AccessMonster.com

I could've sworn I tried that several times, as that was exactly what I was
trying to do--but I obviously had something wrong.
Thanks!
Lawton
 

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