How to use it
- Choose the database and date column.
- Choose last N units, a day, month or custom range.
- Copy the condition, WHERE or SELECT output.
SQL tool
Build last 30 days, today, yesterday, current month or custom range queries for date columns such as CreateDate in seconds.
Practical guide
Choose a column, table, database and time range to generate condition, WHERE and sample SELECT output for the last 30 days, today, yesterday, current month or a custom range.
This tool streamlines workflows such as listing orders from the last 30 days and filtering today's log records in one place.
Automatically generate CreateDate >= DATEADD(DAY, -30, GETDATE()).
Generate a sargable range using date_trunc for the month boundary.
Build a safe range that includes the start and excludes the end.
Wrapping a column in a function can prevent index usage, so the tool calculates boundary values where possible.
It generates suitable date functions for SQL Server, PostgreSQL, MySQL and SQLite.
No. It only generates query text and never connects to your database.
Similar tools