Signed integer difference between start-datetime and end-datetime expressed in the units set by timeunit
(-9223372036854775808, 9223372036854775807)
Additional information
timeunit
TIMEUNIT value
Unit
Declaration
years
yy
months
m
days
d
hours
hh
minutes
mi
seconds
s
milliseconds
ms
microseconds
us
nanoseconds
ns
For a return value out of range, DATETIMEDIFF returns an error. For nanoseconds, the maximum difference between start-datetime and end-datetime is around 293 years and 4 months.
The output is negative, if end-datetime occurs before start-datetime.
Returns null is any of the input parameters is null.