IIF function using dates if date is still null

princessdmb

Registered User.
Local time
Yesterday, 20:54
Joined
Sep 1, 2011
Messages
15
Hello,

I'm trying to calculate the number of days between two dates using the iif statement

Fields:
[LDW] "Last Day Worked"
[ReturnedDate]

DESCRIPTION:
If ReturnedDate is null, then calculate the datediff "d" between LDW with Now(), if not, then calculate the datediff "d" between LDW with ReturnDate.

Not sure if the Iif function would be the appropriate to use or how to put it together.

I tried this but it didn't work at all. :banghead:
Days Absent: Iif(isnull([ReturnedDate],(DateDiff("d",[LDW],Now())),(DateDiff("d",[LDW],[ReturnedDate])))

Your help will be much appreciated!!! :o

Thanks

Denise ♥
 
Your IsNull should be after the ReturnedDate

IIf([ReturnedDate] is Null, TrueBit, FalseBit)
 
LOL.... (literally) such a small thing, thank you so much Minty!!

Have a great Holiday season!!

Denise ♥
 

Users who are viewing this thread

Back
Top Bottom