Did you find this useful?
Socialize it today.


MySQL DATEDIFF Function

Wednesday, December 28, 2011

tags SQL

The MySQL DATEDIFF function returns the difference in time between two dates.

Syntax

DATEDIFF(dateA, dateB)


Example
SELECT DATEDIFF('2011-12-31','2011-12-30') AS [Date Difference]


Results

Date Difference
1

Please help us spread the word by socializing it today!

email contact us

Did you find something wrong with the information on this page? Please take a moment to report it to us so that we can continue to improve the quality of the information on this site. Click here to report an issue with this page.



Recommended Books & Training Resources

SQL Cookbook Head First SQL: Your Brain on SQL A Learners Guide