0% found this document useful (0 votes)
59 views

Add Months Function

The ADD_MONTHS function in Oracle/PLSQL returns a date that is a specified number of months later or earlier than a starting date. The syntax is ADD_MONTHS(date1, n) where date1 is the starting date and n is the number of months to add, which can be positive or negative. Examples show adding and subtracting months from different starting dates.

Uploaded by

1raju1234
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Add Months Function

The ADD_MONTHS function in Oracle/PLSQL returns a date that is a specified number of months later or earlier than a starting date. The syntax is ADD_MONTHS(date1, n) where date1 is the starting date and n is the number of months to add, which can be positive or negative. Examples show adding and subtracting months from different starting dates.

Uploaded by

1raju1234
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Oracle/PLSQL: ADD_MONTHS Function

In Oracle/PLSQL, the ADD_MONTHS function returns a date plus n months.

Syntax
The syntax for the ADD_MONTHS function is: ADD_MONTHS( date1, n ) date1 is the starting date (before the n months have been added). n is the number of months to add to date1.

Applies To

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

For Example
The ADD_MONTHS function can be used in Oracle/PLSQL. For example: ADD_MONTHS('01-Aug-03', 3) ADD_MONTHS('01-Aug-03', -3) ADD_MONTHS('21-Aug-03', -3) ADD_MONTHS('31-Jan-03', 1) would return '01-Nov-03' would return '01-May-03' would return '21-May-03' would return '28-Feb-03'

You might also like