Oracle PL/SQL - ADD_MONTHS function

ADD_MONTHS Function : 

Syntax : ADD_MONTHS (date,n); 
  • Return type of ADD_MONTHS is always a date.
  • n is a integer or any other value that can be converted to a integer
  • date can be either in a date format or any other value that can be converted to a date format.

Example 1:

SELECT ADD_MONTHS('02-MAR-2015',3) "RESULT" FROM DUAL

RESULT
-----------
02-JUN-2015

Example 2:

SELECT ADD_MONTHS('30-JAN-2015',1) "RESULT" FROM DUAL

RESULT
-----------
28-FEB-2015

Note : If the date is last day of the month or the resulting month has less number of days than the input date, then the resulting date is always the last day of the month