Skip Headers
Oracle® OLAP DML Reference
11g Release 2 (11.2)

Part Number E17122-07
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

ADD_MONTHS

The ADD_MONTHS function returns the date that is n months after the specified date.

Return Value

DATETIME

Syntax

ADD_MONTHS(start_datetimen)

Parameters

start_datetime

A DATETIME expression that identifies the starting date. When the day component of start_datetime is the last day of the month or when the returned month has fewer days, then the returned day component is the last day of the month. Otherwise, the day component of the returned date is the same as the day component of start_datetime. See Example 7-2, "End-of-Month Calculation".

n

An INTEGER that identifies the number of months to be added to start_datetime.

Examples

Example 7-2 End-of-Month Calculation

The following statement displays the date of the day that is one month after January 30, 2000.

SHOW ADD_MONTHS('30Jan00', 1)

Since February 29 was the last day of February 2000, ADD_MONTHS returns February 29, 2000.

29-Feb-00