I have a situation and I could nog figure out how to solve this issue.
The dates RegisterdateTime en ClosedDateTime in the example below are Dates plus Time. In the example i let them away.
In my script i introduced a extra field named TurnAround. The code behind TurnAround is:
IF (CLOSEDDATETIME <> MakeDate(1900,1,1), DATE(FLOOR(NUM(CLOSEDDATETIME))) - DATE(FLOOR(NUM(REGISTRATIONDATETIME))),0 ) AS TURNAROUND
Id RegisterDateTime ClosedDateTime turnAround
1 01-11-2012 10-11-2012 9
2 08-11-2012 16-11-2012 8
3 20-11-2012 01-01-1900
The function for turnAround does work for the items that has a closedDateTime. But what i want is dat every record that has a ClosedDateTime of 01-01-1900 should go in the formula with the date of today. So in example of ID =3 the formula should be 26-11-2012 - 20-11-2012 is turnAround of 6 days