I have a time (without date component) like 9am, let’s say it’s the current time. I want to query all entrys from a table where this time is between a Start and a End time stored as Timestamp.
How do I do this? Should I store it differently?
I tried something like SELECT * FROM tab1 WHERE (current_timestamp - current_date) BETWEEN starttime AND endtime; but that doesn’t work because the difference calculated is always (almost) zero. I could do something with the EXTRACT-command, but that seems to be a little complicated… Isn’t there an easy way to do this?
Basically, they are stored appointments.
Thanks in advance.
Try: