Basically what I want try to do is to get shift in range between
already get with this where
where @param_value_from_hour between From_Hour and To_Hour
it works when @param_value_from_hour let say 16:00 but what if I have to search @param_value_from_hour with 19:00?
If the logic is that, if the end of the period is earlier than the start of the period then the period is assumed to span midnight (if it isn't, we need some other form of convention or things get hopelessly ambiguous):
Should get approximately what you want (adjust
<
for<=
if required)Try this:
thank you for all your valuable respon
so this is the answer combine from 2 answer
thank you guys, you're awesome!!
Convert your
time
columns todatetime
and compare