Other related articles:

Recently viewed articles:


SQL ADD_MONTHS function adds integer valueto months in date value. If date is the last day of its month, the result is forced to the last day of the result month. If the target month has fewer days than date’s month, the result is also forced to the last of the month. SQL ADD_MONTHS function returns a result after adding a number in months to date. The number argument may be a negative number in which case it will subtract months from date value.

The syntax is:
ADD_MONTHS(date , integer);

Example 1:

The following SQL ADD_MONTHS function example adds 15 months to hire_date of each employee:

SELECT hire_date, ADD_MONTHS (hire_date, 15) FROM employee;


sql add_months image1

Example 2:
The following SQL ADD_MONTHS function returns the date ’24-JUL-99’as result:
SELECT ADD_MONTHS ('24-FEB-1999',5) FROM dual;


sql add_months image2