Help with IIF Function

Tremor

Registered User.
Local time
Today, 03:39
Joined
May 2, 2009
Messages
13
Hi everyone

I wonder if someone can help me with an IIF function in a query.

I'm calculating the NoOfDays field. This field only apperars in the query and is currently calculated by the following:-

NoOfDays: DateDiff("d",[InvoiceDate],[CurrentDate])

I type this into a field box in the query design page.

This works fine for now, however I now need the NoOfDays field to display a 0 if the Paid field has a Y in it, otherwise I still want the previous calculation to apply. I've tried playing with the IIF function which I think should do it but I think it's where to put brackets and inverted commas that is letting me down.
 
Iif([paid]=Y,0,DateDiff("d",[InvoiceDate],[CurrentDate]) )
 

Users who are viewing this thread

Back
Top Bottom