MONTHS function [Date and time]

If you give a single date, this function returns the number of months since 0000-02.

Note

0000-02 is not meant to imply an actual date; it is the date used by the date algorithm.

If you give two time stamps, this function returns the integer number of months between them. Instead, use the DATEDIFF function.

If you give a date and an integer, this function adds the integer number of minutes to the specified timestamp. Instead, use
the DATEADD function.

Syntax 1: integer

MONTHS( [ datetime-expression, ] datetime-expression)

Syntax 2: timestamp

MONTHS(datetime-expression, integer-expression)

Parameters

datetime-expression A date and time.

integer-expression The number of months to be added to the datetime-expression. If integer-expression is negative, the appropriate number of months is subtracted from the datetime value. If you supply an integer-expression, the datetime-expression must be explicitly cast as a datetime data type.