AnsweredAssumed Answered

If Else statement help

Question asked by StevenWood on Apr 8, 2015
Latest reply on Apr 10, 2015 by StevenWood

Title

If Else statement help

Post

I'm having some difficulty getting this to work:

If [ (Get (CurrentDate) > (Vacation::Start Date + 179)) ]
Set Field [ Vacation::Test container ; 0 ]
Else If [ (Get (CurrentDate) ≥ (Vacation::Start Date + 180)) and (Get (CurrentDate) < (Vacation::Start Date + 365.24)) ]
Set Field [ Vacation::Test container ; 40 ]
Else If [ (Get (CurrentDate) ≥ (Vacation::Start Date + 365.25)) and (Get (CurrentDate) < (Vacation::Start Date + 730.49)) ]
Set Field [ Vacation::Test container ; 80 ]
Else If [ (Get (CurrentDate) ≥ (Vacation::Start Date + 730.5)) and (Get (CurrentDate) < (Vacation::Start Date + 1826.24)) ]
Set Field [ Vacation::Test container ; 120 ]
Else
Set Field [ Vacation::Test container ; 160 ]
End If

No matter what the start date is I either get a result of 0 or 160 but nothing in between.  I have looked for examples but have found none.  I'm sure it is a simple syntax error, but I'm lost.  Also, this is the first time programming in this language so please be kind.

Thank you.

Outcomes