DateDiff

The DateDiff() function calculates the difference between two dates. You can use the DateDiff for the difference in: year, month, week, day, hour, minute or second.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

Returns a number that is the difference between two dates in a specific unit. If one of the two dates is unknown then this function returns unknown.

Returns Unknown if one of the parameter values is unknown or outside the common valid date boundaries.

Syntax

DateDiff(start_date, end_date, unit)

DateDiff('2014-08-21', '2002-12-31', Year) =>Result: 11

DateDiff() =>Result: unknown

Parameters

Last updated