ADD_MONTHS
Description
ADD_MONTHS adds a given number of months to a given date.
Supported input column types: base_column -> DATE, months_column -> INT
Output column type: DATE
If the input date is last day of the month, the resulting date will be last day of the month.
If a result of type DATE is outside the interval from the year 1400 CE (including) to the year 10000 CE (excluding), it will be mapped to NULL.
Syntax
ADD_MONTHS ( table.base_column, table.months_column )
NULL handling
If any parameter is NULL, the result is NULL as well.
Example
[1] Simple example for ADD_MONTHS. | |||||||||||||||||||
| |||||||||||||||||||
|
[2] Leap years behavior with ADD_MONTHS. | ||||||||||||||||||||||
| ||||||||||||||||||||||
|
[3] ADD_MONTHS behavior when input date is the last day of the month. The resulting date is also the end of the month. | |||||||||||||
| |||||||||||||
|