Database & SQL
MySQL Date Expression Builder
Pick a column and a date range to get a correct MySQL filter clause instantly —
today, last 7 days, this month, year to date,
and more. Everything is generated locally in your browser.
Build the filter
live
Use created_at or table.column. Names that need
quoting (reserved words, spaces, leading digits) are wrapped in backticks.
Add a table to wrap the filter in a complete SELECT statement.
Generated expression
MySQL
How it works
The builder writes standard MySQL date functions such as CURDATE(),
NOW(), DATE_FORMAT(), and INTERVAL arithmetic.
Calendar ranges use half-open bounds (column >= start AND column < end)
to avoid double-counting the end of a period. Choose the UTC basis when you do not want
the result to depend on the connection’s session time zone. Nothing is sent to a
server — the SQL is produced entirely in your browser.