I have a table that stores the date/time in datetime format. I need to select the current day's data that fall between a certain time range . I tried to_char() but the comparison against a time range is incorrect as it has been converted. This is what I'm trying to do:
select my_datetime from my_table
where my_datetime between '12:00' and '2:00'