Forum Discussion

szqz_531's avatar
szqz_531
New Member
8 years ago
Solved

How to consider working hour in time different

I need to calcualte two datetime stamp difference with the working hour consideration.

 

I have extracted the time (field name: TMS[Arrived_time]) from the datetime stamp,like:

 

16:40:00, 08:00:00, ,,,,,,,

working hour start at 08:30:00, end at 23:00:00

but when i write the fuction like below:

If_working_hour_flag_arrived = if(and(TMS[Arrived_time]>=TMS[Working_hour_Start],TMS[Arrived_time]<=TMS[Working_hour_End]),1,0)

 

the result are all 0,

but for TMS[Arrived_time] =16:40:00, the result should be 1.

 

Anyone have some thoughts?