MySQL: Check if date is between data range
15 June 2025 (Updated 15 June 2025)
On this page
Option 1: Using BETWEEN
SELECT *
FROM your_table
WHERE your_date_column BETWEEN '2024-01-01' AND '2024-12-31';
This is an inclusive search so it’ll match the 2024-01-01
and 2024-12-31
dates.
Option 2: Using >=
and <=
SELECT *
FROM your_table
WHERE your_date_column >= '2024-01-01'
AND your_date_column <= '2024-12-31';
This is also an inclusive search so it’ll match the 2024-01-01
and 2024-12-31
dates.
Tagged:
SQL recipes