ADD_MONTHS

functionsupportedCore SQL functions

docs.snowflake.com ↗

Date & time functions

Adds or subtracts a specified number of months to a date or timestamp, preserving the end-of-month information.

Syntax

ADD_MONTHS( <date_or_timestamp_expr> , <num_months_expr> )

Parameters

NameRequiredDescription
date_or_timestamp_exprrequiredThis is the date or timestamp expression to which you want to add a specified number of months.
num_months_exprrequiredThis is the number of months you want to add. This should be an integer. It may be positive or negative. If the value is a non-integer numeric value (for example, FLOAT) the value will be rounded to the nearest integer.

Returns

The data type of the returned value is the same as the data type of the first parameter. For example, if the input is a DATE, then the output is a DATE. If the input is a TIMESTAMP_NTZ, then the output is a TIMESTAMP_NTZ.

Usage notes

Referenced by