Calculate Difference Between Timestamps
This statement returns 7 because the second timestamp (2021-12-20 12:00:00) is 7 months greater than the first one:
SELECT {fn TIMESTAMPDIFF(SQL_TSI_MONTH,
'2021-5-19 00:00:00','2021-12-20 12:00:00')}
This statement returns 566 because the second timestamp ('12:00:00') is 566 minutes greater than the first one (02:34:12):
SELECT {fn TIMESTAMPDIFF(SQL_TSI_MINUTE,'02:34:12','12:00:00')}
This statement returns -1440 because the second timestamp is one day (1440 minutes) less than the first one:
SELECT {fn TIMESTAMPDIFF(SQL_TSI_MINUTE,'2021-12-06','2021-12-05')}