How to Get Yesterday’s Date in MySQL Database: MySQL Operators: CURDATE() DATE_SUB() INTERVAL Table of Contents Problem Solution Discussion 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 in MySQL Common MySQL Functions SQL Practice Set in MySQL Recommended articles: MySQL Cheat Sheet Performing Calculations on Date- and Time-Related Values Analyze Time Series COVID-19 Data with Window Functions Get to Know the Power of SQL Recursive Queries MySQL Date Functions: Complete Analyst’s Guide See also: How to Get the Year from a Datetime Column in MySQL How to Find the Last Day of a Month 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 Subscribe to our newsletter Join our monthly newsletter to be notified about the latest posts. Email address How Do You Write a SELECT Statement in SQL? What Is a Foreign Key in SQL? Enumerate and Explain All the Basic Elements of an SQL Query