Back to list MySQL How to Get Yesterday’s Date in MySQL Database: MySQL Operators:CURDATE(), DATE_SUB(), INTERVAL Problem: You would like to display yesterday's date (without time) in a MySQL database. Solution: SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS yesterday_date; Assuming today is 2020-09-24, the result is: yesterday_date 2020-09-23 Discussion: To get yesterday's date, you need to subtract one day from today's date. Use CURDATE() to get today's date. In MySQL, you can subtract any date interval using the DATE_SUB() function. Here, since you need to subtract one day, you use DATE_SUB(CURDATE(), INTERVAL 1 DAY) to get yesterday’s date. Note that the result of this calculation still has the column type date. You can go back by any time interval just as easily. Here's an example: SELECT DATE_SUB(CURDATE(), INTERVAL 2 MONTH) AS date_two_months_ago; You can also calculate tomorrow's date very easily. Use the DATE_ADD() function to add an interval to a date. SELECT DATE_ADD(CURDATE(), INTERVAL 1 DAY) AS tomorrow_date; Recommended courses: SQL Basics Revenue Trend Analysis in SQL SQL Practice Set Recommended articles: Performing Calculations on Date- and Time-Related Values How to Analyze Time Series COVID-19 Data with SQL Window Functions Get to Know the Power of SQL Recursive Queries See also: How to Get the Year from a Datetime Column in MySQL How to Find the Last Day of the Month for a Given Date in MySQL How to Add Time to a Datetime Value in MySQL How to Find the Number of Days Between Two Dates in MySQL How to Add Days to a Date in MySQL Tags: MySQL Subscribe to our newsletter Join our weekly newsletter to be notified about the latest posts.