Collections:
Calculating the Difference between Two Dates in MySQL
How To Calculate the Difference between Two Dates in MySQL?
✍: FYIcenter.com
If you have two dates, and you want to know how many days between them, you can use the DATEDIFF(date1, date2) function as shown below:
SELECT DATEDIFF(DATE('1997-02-28'), DATE('1997-03-01')) FROM DUAL; -1
⇒ Calculating the Difference between Two Time Values in MySQL
⇐ Decrementing a Date by 1 in MySQL
2017-12-26, 1438👍, 0💬
Popular Posts:
What Do You Need to Connect PHP to MySQL in MySQL? If you want to access MySQL database server in yo...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
How To Replace Given Values with NULL using NULLIF() in SQL Server Transact-SQL? Sometime you want t...
How To Recover a Dropped Index in Oracle? If you have the recycle bin feature turned on, dropped ind...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...