Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i have following problem. I want to define 3 shifts-> Early, Late and Night. I have an field with an time/datestamp as follow
26.01.2016 22:00:12
The Earlyshift is from 06:00:00 to 13:59:59
Lateshift from 14:00:00 to 21:59:59 and the
Nightshift from 22:00:00 to 05:59:59.
How can i solve my problem?
In the script? May be like this:
If(TimeStamp(TimeStampField) >= MakeTime(6, 0, 0) and TimeStamp(TimeStampField) <= MakeTime(13, 59, 59), 'Earlyshift',
If(TimeStamp(TimeStampField) >= MakeTime(14, 0, 0) and TimeStamp(TimeStampField) <= MakeTime(21, 59, 59), 'Lateshift', 'Nightshift') as Shift
1st extract time from this field like?
Interval(YourDateTimeField)
then at script with IF condition like this?
=if(Interval(YourDateTimeField)>=Interval('06:00:00') and Interval(YourDateTimeField)>=Interval('13:59:59'),'Earlyshift',
if(Interval(YourDateTimeField)>=Interval('14:00:00') and Interval(YourDateTimeField)>=Interval('21:59:59'),'Lateshift ',
if(Interval(YourDateTimeField)>=Interval('22:00:00') and Interval(YourDateTimeField)>=Interval('05:59:59'),'Nightshift '))) as shift