validate shift
if i have a shift from 23:00 to 08:00
if i want to validate 30/7/2018 23:18:00 on this shift by this code
select count(*)
from mo_shifts ms
where to_char('30/7/2018 23:18:00', 'hh24:mi') between ms.on_duty_time and
ms.off_duty_time
this code is wrong because :
between 23:00 and 8.00
because 23 greater than 8
what is the correct code ?