Functions for Working with Dates

ADD_MONTHS

Syntax

ADD_MONTHS(d, x)

Description

The ADD_MONTHS function returns the date "d" increased by x months. Any integer can be selected as the x argument. If the number of days in the resulting month is less than in the d month, the last day of the resulting month is returned. If the number of the days is the same or less, the day of the resulting month and the d month coincide. Time components of the d date and the result are identical.

Example

VAL < ADD_MONTHS(SYSDATE, 12)

Value of the VAL field (type Date) cannot exceed the current date by more than twelve months.

See also:

Built-in SQL Functions | Table Constraints