Dates are compared like numbers
A date column holds a real point in time, so you compare it with < and >= just like a number, writing the date in quotes as year-month-day. To pick a whole month, ask for dates on or after the first of that month and before the first of the next.
A tiny example
In plain English: Show me the names of the students who joined during March 2019.
SELECT name
FROM students
WHERE joined >= '2019-03-01' AND joined < '2019-04-01';What comes back
| name |
|---|
| Priya |
| Tom |
Priya and Tom are the only students who joined sometime in March 2019.
Related SQL lessons
Ready for a break?
Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.
play today's sip