SELECT CURDATE(); Output is 2025-11-29 , this is in the format YYYY-MM-DDCURDATE()
SELECT CURDATE()- interval 1 day as Yesterday,
CURDATE() as Today,
CURDATE()+ interval 1 day as Tomorrow
| Yesterday | Today | Tomorrow |
| 2025-11-28 | 2025-11-29 | 2025-11-30 |
SELECT CURDATE()- interval 1 month as LastMonth,
CURDATE() as Today,
CURDATE()+ interval 1 Month as NextMonth
| Last Month | Today | Next Month |
| 2025-10-29 | 2025-11-29 | 2025-12-29 |
SELECT DATE_FORMAT(CURDATE() - INTERVAL 1 MONTH,'%Y-%m-01')
SELECT LAST_DAY(CURDATE() - INTERVAL 1 MONTH)
| Last Month First Day | Last Month Last Day |
| 2025-10-01 | 2025-10-31 |
SELECT * FROM `dt_table` WHERE
date BETWEEN DATE_FORMAT(CURDATE() ,'%Y-%m-01') AND CURDATE()
More on BETWEEN DATE Query
Read more on how to store default date and time in MySQL table here.
Examples of CURDATE() to get different range of records.
SQL Date References Group By in Date field NOW() : Current Date with Time
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.