https://questdb.io logo
Title
j

John M.

03/07/2023, 5:33 PM
Is it possible to query on just the time portion of a timestamp or datetime type? For example, across 10 days, query only timestamps where the time portion is between 09:30:00 and 16:00:00, even though there are multiple different dates? I could do this on a day-by-day basis obviously by changing the date, but across a 10 day span, I'm not sure how to do that without something that can split out just the time from the full timestamp.
a

Alex Pelagenko

03/07/2023, 6:12 PM
should be something like
timestamp in '2023-01-01T09:30:00.000000Z;450m;1d;10'
j

javier ramirez

03/08/2023, 9:10 AM
And if your date is the upper bound, rather than the lower, you can also work with backward intervals, thanks to this contribution from the community https://github.com/questdb/questdb/pull/2943. Just add a minus to the interval
timestamp in '2023-01-01T09:30:00.000000Z;450m;-1d;10'