TIMESTAMPDIFF function (ODBC compatible)
TIMESTAMPDIFF(interval, date_time_exp1, date_time_exp2)
Returns an integer representing the number of intervals by which date_time_exp2 is greater than date_time_exp1.
The following example displays difference in seconds between the current system time and one day later.
> select timestampdiff(sql_tsi_second, sysdate, sysdate + 1) from syscalctable;
If either date-time expression is a time value and interval specifies days, weeks, months, quarters, or years, the date portion of that expression is set to the current date before calculating the difference between the expressions.
If either date-time expression is a date value and interval specifies fractional seconds, seconds, minutes, or hours, the time portion of that expression is set to 0 before calculating the difference between the expressions.