convert Excel formula to Access query expression

bowgieman

New member
Local time
Today, 14:57
Joined
Jan 15, 2013
Messages
1
Hi,

I hope someone can help me. I have a formula that I have created in Excel, and I am trying to use the same method to create an expression in my Access query, but I am not getting the same result.

My excel formula is:
=IF(D2<>"",D2-C2,IF(AND(C2<>"",MAX(A2-C2,0)=0),B2-C2,B2-A2))

And this is my attempt for the access query expression:
IIf(IsNull([D]),IIf(Sgn([A]-[C])=-1,-[A],
-[C]),[D]-[C])

Basically all four cells/fields contain a date in dd/mm/yyyy format.
I want to find out the number of days between two dates if they meet the condition in the Excel formula.

I would be grateful for some help.

Many thanks
 

Attachments

Users who are viewing this thread

Back
Top Bottom