5 Replies Latest reply on Aug 27, 2009 2:20 PM by comment_1

# IF statements with dates and calculations (FP10)

### Title

IF statements with dates and calculations (FP10)

### Post

I have a calculation field with the following:

If (M Date To ≤ 31/8/2009;Total kms * .62;Total kms * .7)

The first part of the If statement is not happening - and is only calculating the second part, regardless of the date.

I have tried this one also -

If (M Date To ≤ 31/8/2009;Total kms * .62; If (M Date To  ≥ 1/9/2009;Total kms * .7))

I can't seem to get it to work. Can anyone help?

• ###### 1. Re: IF statements with dates and calculations (FP10)
See if this helps.
• ###### 2. Re: IF statements with dates and calculations (FP10)
Thanks for your prompt reply, however still no solution. I have also tried the Case statement to no avail. This is such a simple equation so I must be incredibly dum....
• ###### 3. Re: IF statements with dates and calculations (FP10)

Perhaps you missed the part about wrapping your date with a proper Date () function?

As Comment pointed out in that other thread, 31/8/2009 is not a date. It is 31 divided by 8, then divided by 2009

• ###### 4. Re: IF statements with dates and calculations (FP10)

Thank you very much. It now looks like this and works -

If ( M Date To ≤ Date (8; 31; 2009); Total kms * .62; Total kms * .7)

• ###### 5. Re: IF statements with dates and calculations (FP10)

I'd suggest you also consider this part from the same thread:

Even better, do not hard-code any specific data in a calculation formula at all.