Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following table :
I would like to write Load script that adds to the above table another column named Shift as follows:
note that when :
1.time_in---> between 06:00-15:00 it returns Morning
2.time_in---> between 15:01-22:59 it returns Evening
3.time_in---> between 23:00-23:59 or between 00:00 - 05:59 (the next day) it returns Night
thanks,
Sharbel
Hi @Sharbel
Perhaps like this?
If(Time(time_In) >= Time('06:00') and Time(time_In) <= Time('15:00'),'Morning',
If(Time(time_In) >= Time('15:01') and Time(time_In) <= Time('22:59'),'Evening',
If(Time(time_In) >= Time('23:00') and Time(time_In) <= Time('23:59') and Time(time_In) >= Time('00:00') or Time(time_In) <= Time('05:59'),'Night'))) as Shift
Hi @Sharbel
Perhaps like this?
If(Time(time_In) >= Time('06:00') and Time(time_In) <= Time('15:00'),'Morning',
If(Time(time_In) >= Time('15:01') and Time(time_In) <= Time('22:59'),'Evening',
If(Time(time_In) >= Time('23:00') and Time(time_In) <= Time('23:59') and Time(time_In) >= Time('00:00') or Time(time_In) <= Time('05:59'),'Night'))) as Shift
Hi ,
I am not sure the "Night" is calculated right since it is supposed to refer to time_in the following day and not the same day as you suggested above
any ideas?
sharbel
If(Time(time_In) >= Time('06:00') and Time(time_In) <= Time('15:00'),'Morning',
If(Time(time_In) >= Time('15:01') and Time(time_In) <= Time('22:59'),'Evening',
If(Time(time_In) >= Time('23:00') and Time(time_In) <= Time('23:59') and or Time(time_In) >= Time('00:00') or and Time(time_In) <= Time('05:59'),'Night'))) as Shift