View Full Version : Either / Or Query


Haynesey
07-29-2003, 04:49 AM
Please help,

I have designed a query to calculate the number of days between two different date fields. If the second date field is blank, i want the query to assume that the date is 31/7/03. However, if it has a value to take that instead. Can this be achieved in one query?

Thanks in advance

Lee

Mile-O
07-29-2003, 04:52 AM
Use the IIf() function to determine if the second date field is blank.

Haynesey
07-29-2003, 04:55 AM
Thanks, would you be able to do me a quick example please.

Would really appreciate it.

Cheers

Lee

MattS
07-29-2003, 05:59 AM
Try:

IIF([SecondDateField] Is Null, #31/07/2003#, [FirstDateField])