Oracle Built In Functions:ADD_MONTHS Function

In Oracle PL/SQL ADD_MONTHS function Returns the date d plus n months. The argument n can be any integer. If d is the last day of the month or if the resulting month has fewer days than the day component of d, then the result is the last day of the resulting month. Otherwise, the result has the same day component as d.

Syntax

ADD_MONTHS(d,n)

Example

SELECT TO_CHAR(
ADD_MONTHS(hiredate,1),
‘DD-MON-YYYY’) “Next month”
FROM employee
WHERE emp_name = ‘PETER’;

Next Month
———–
20-MAR-1990

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




CAPTCHA Image CAPTCHA Audio
Refresh Image

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .