Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have Field
Morning shift time 06.00-13.59 hrs. Afternoon shift 14.00-21.59 hrs. Night shift 22.00-05.59 hrs. I need shift field = Morning Afternoon Night I want to bring time TimeStartDowntime to TimeFinishDowntime is divided into shifts.
EX
StartDowntime ='11:42:40' to FinishDowntime ='23:03:38'
The shifts are morning, afternoon, and night.
I need a field that displays values like this.
Try this.
If(TimeStartDowntime >= PurgeChar(MakeTime(06,00,00),'AMP') and TimeFinishDowntime <= PurgeChar(MakeTime(13,59,59),'AMP'), 'Morning',
If(TimeStartDowntime >= PurgeChar(MakeTime(14,00,00),'AMP') and TimeFinishDowntime <= PurgeChar(MakeTime(21,59,59),'AMP'), 'Afternoon',
If(TimeStartDowntime >= PurgeChar(MakeTime(22,00,00),'AMP') and TimeFinishDowntime <= PurgeChar(MakeTime(05,59,59),'AMP'), 'Night' ))) as Shift
No. Is there another way?
Could you share a sample of the data?
Retry with this.
If((Time(TimeStartDowntime) >= Time('06:00:00') and Time(TimeStartDowntime) <= Time('13:59:59')), 'Morning',
If((Time(TimeStartDowntime) >= Time('14:00:00') and Time(TimeStartDowntime) <= Time('21:59:59')),'Afternoon',
If((Time(TimeStartDowntime) >= Time('22:00:00') and Time(TimeStartDowntime) <= Time('23:59:59')) or (Time(TimeStartDowntime) >= Time('00:00:00') and Time(TimeStartDowntime) <= Time('05:59:59')),'Night'))) as CheckPart_Shift