Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Expression Based on Time

I have a date time field called OnSceneTime.

I need to strip out just the time (hhmm) and then compare this to a fixed value to see if the call was made on time or not.

For example I have a range of 1200-1500 (12 - 3 PM).  If the OnSceneTime is between these times then it was on time.  If it was after 3PM then it was late.

What is the best way to do this?

2 Replies
sunny_talwar

May be like this

If(Frac(OnSceneTime) < MakeTime(12), 'Early',

If(Frac(OnSceneTime) >= MakeTime(12) and Frac(OnSceneTime) <= MakeTime(15), 'On Time',

If(Frac(OnSceneTime) > MakeTime(15), 'Late')))

eduardo_dimperio
Specialist II
Specialist II

Hi Mark

Try this

If(Interval( A-B, 'D hh:mm' ) >0,'Early',

If(Interval( A-B, 'D hh:mm' ) <0,'Late','OnTime'))