How do I filter rows between 2025-01-15 and 2025-01-31 with SQL?
SELECT * FROM data
WHERE order_date BETWEEN '2025-01-15' AND '2025-01-31'
ORDER BY order_date;
Run this query in QueryLocal →
With dates stored as `YYYY-MM-DD` text, `BETWEEN '2025-01-15' AND '2025-01-31'` works correctly because that format sorts the same way alphabetically and chronologically — no date parsing needed, just a plain inclusive range check.
A table named data with columns: order_id (integer), customer (text), country (text), category (text), quantity (integer), unit_price (real), order_date (text, YYYY-MM-DD).