Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Estoy intentando categorizar rangos de hora y clasificarlos en turnos, de tal manera que :
Mañana: 07.00-15.00
Tarde: 15.00-23.00
Noche: 23.00-7.00
Esto indicando esto, pero el de la Noche me lo deja en blanco:
IF(Hour("FECHA_FABRICACION") >= 7, IF(Hour("FECHA_FABRICACION") <= 15,'M',IF(Hour("FECHA_FABRICACION") > 15, IF(Hour("FECHA_FABRICACION") <= 23, 'T', 'N'),'N'))) as TURNO
I am trying to categorize hour ranges and classify them in shifts, in such a way that :
Morning: 07.00-15.00
Afternoon: 15.00-23.00
Night: 23.00-7.00
This is my expression, but the Night one leaves it blank: IF(Hour("DATE_MANUFACTURING") >= 7, IF(Hour("DATE_MANUFACTURING") <= 15,'M',IF(Hour("DATE_MANUFACTURING") > 15, IF(Hour("DATE_MANUFACTURING") <= 23 , 'T', 'N'),'N'))) as TURN
IF(Hour("DATE_MANUFACTURING") >= 7 and Hour("DATE_MANUFACTURING") <15,'M',
IF(Hour("DATE_MANUFACTURING") >= 15 and Hour("DATE_MANUFACTURING") <23,'T',
IF(Hour("DATE_MANUFACTURING") >= 23 or Hour("DATE_MANUFACTURING") < 7,'N',
))) as TURN
IF(Hour("DATE_MANUFACTURING") >= 7 and Hour("DATE_MANUFACTURING") <15,'M',
IF(Hour("DATE_MANUFACTURING") >= 15 and Hour("DATE_MANUFACTURING") <23,'T',
IF(Hour("DATE_MANUFACTURING") >= 23 or Hour("DATE_MANUFACTURING") < 7,'N',
))) as TURN
It works! Thank you so much!