Calculates a date value by adding months to (or subtracting months from) a specified date value.
|date||a date, or an expression that evaluates to a DATE data type|
|number||a number, or an expression that evaluates to a number|
Number, representing a DATE value.
Use $addmonths to perform arithmetic with date values. The $addmonths function calculates a date value by adding a number representing months to a date value. If number is negative, the effect is to subtract the months from the date.
The + (add) and – (subtract) operators can be used to achieve the same results.
If date or the result of the $addmonths expression is an invalid date (e.g., 19930231), it is adjusted to produce a valid date (e.g., 19930228).
If $Date has the value 19981225, then:
Evaluates to 19990325.
Evaluates to 19980925.
Evaluates to 20000825.
Evaluates to 19980228 (note truncation).