'How to query rows by intraday time range in sqlite
I have a column that consists of the datetime for each entry in the table. The entries are across many days and across all times. I want to filter only for entries that happened between a certain time period in the day, like between 10am and 1pm. How does one do that?
The datetimes are stored as a string in ISO-8601 format. Ex: 2021-01-22T12:50:00-05:00
Solution 1:[1]
First, keep the sqlite Date and Time Functions doc handy.
Something like:
WHERE strftime("%H:%M",yourdate) between "10:00" and "13:00"
should accomplish the task.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DinoCoderSaurus |
