I have a check query that I only want to return data for during specific hours of 03:00 to 22:00 hours, lets say for example the check will return 0 or 1, where 1 is an error. outside of those hours (10pm to 3am) its possible for it to validly return 1 so I wont want to return an error so Im going to use case against sysdate and if its in those hours I'll return 0.
so something like
select case
when sysdate between 10pm and 3am
then 0
else t1.some_value
from
(select some_value from t1)
how to write that when clause? Do I convert to char and compare or leave it as a date compare