Return rows between two timestamps.
Section: basic selects
Filter by date range
sql
sql
SELECT id, created_at FROM orders WHERE created_at BETWEEN '2026-01-01' AND '2026-01-31 23:59:59';Explanation
Use explicit endpoints to avoid off-by-one issues in reporting.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing basic selects