DATEDIFF

{DATEDIFF | TIMESTAMPDIFF} (unitString, aTimestamp, bTimestamp)

Description

Returns the the number of crossed unit boundaries between two timestamps. This method returns a long. The string indicates the unit. The same units as in the EXTRACT function are supported.

Examples

DATEDIFF('YEAR', T1.CREATED, T2.CREATED)