Parameters (Timestamp, Timestamp, Integer);
Returns: Integer;
Function to obtain the difference between two dates.
The first parameter is the first date.
The second parameter is the second date.
The third parameter is an integer indicating the type of unit to return.
4 = Days
3 = Hours
2 = Minutes
1 = Seconds
If date 1 is greater than date 2, the result will be negative.
Only whole units are returned.
Example 1: DATEDIFF('2015-07-15 12:00:00','2015-07-19 11:00:00',4) = 3
Example 2: DATEDIFF('2015-07-15 12:00:00','2015-07-15 11:54:10',2) = -5
Comments
0 comments
Please sign in to leave a comment.