Page 1 of 1

Formula Editor

Posted: Mon Jul 04, 2011 2:16 am
by cklahr
How do I code dates within an If Then formula?

I would like to code the following: If the property is in a particular county, the requested tasks due date should be 2 days after requested. Otherwise, it should be 5 days after requested. Please advise.

Thanks.

Re: Formula Editor

Posted: Fri Jul 08, 2011 10:03 am
by Mark McKenna
I apologize for the delay. Try this:

Code: Select all

If ( {{Order.Property[1].County}} == "Wake" ) Then
	Value = DateAdd( {{.RequestedDate}}, 2, "d", true )
Else
	Value = DateAdd( {{.RequestedDate}}, 5, "d", true )
EndIf
Note that a requested task has no explicit relationship with a particular property, so here we assume that it's the first property in the order that should be consulted.

Re: Formula Editor

Posted: Mon Jul 11, 2011 2:58 am
by cklahr
Thank you very much. That works great!!