INTERVAL function

Returns the time interval between two DATE, DATETIME, or DATETIME-TZ values as an INT64 value.

Syntax

INTERVAL ( datetime1 , datetime2 , interval-unit )
datetime1
An expression whose value is a DATE, DATETIME, or DATETIME-TZ.
datetime2
An expression whose value is a DATE, DATETIME, or DATETIME-TZ.
interval-unit
A character constant, or a character expression that evaluates to one of the following time units: ‘years', ‘months', ‘weeks', ‘days', 'hours', ‘minutes', ‘seconds' or ‘milliseconds'. These values are case insensitive and might be singular.

Notes

See also

- Date subtraction operator, - Datetime subtraction operator, ADD-INTERVAL function, DATE function, DATETIME function, DATETIME-TZ function