Built-in Functions → addMonths

addMonths() is a scalar date function that returns the sum of a date value and a specified number of months, in which the integer number (+/-) of months added to a given date is in the format "yyyy-MM-dd".

Signature

addMonths(date exp, int months)

The following table illustrates the addMonths() parameters:

ParameterDescription
date expdate to add months to
int monthsint months to add to date exp

Returns

date

Example

Add 3 months to the dates in Sales_Acme.Sales.TIME_ID.

addMonths(Sales_Acme.Sales.TIME_ID, 3)