MONTHS_BETWEEN
Returns the number of months between two date or timestamp values.
Syntax
MONTHS_BETWEEN(date_timestamp_expression1 string, date_timestamp_expression2 string) → float
date_timestamp_expression1: The
DATE
orTIMESTAMP
to subtract from.date_timestamp_expression2: The
DATE
orTIMESTAMP
to subtract.
Examples
MONTHS_BETWEEN example
Usage Notes
If date or timestamp date_timestamp_expression1
represents an earlier point in time than date_timestamp_expression2
, then MONTHS_BETWEEN(date_timestamp_expression1, date_timestamp_expression2)
returns a negative value; otherwise it returns a positive value. You can use a date value for one input parameter and a timestamp for the other.
Last updated