Combine ADD_MONTHS() with TO_CHAR() and TO_DATE : ADD_MONTHS « Date Timestamp Functions « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> SELECT TO_CHAR(ADD_MONTHS(TO_DATE('01-JAN-2005 19:15:26',
  2    'DD-MON-YYYY HH24:MI:SS'), 2), 'DD-MON-YYYY HH24:MI:SS')
  3  FROM dual;

TO_CHAR(ADD_MONTHS(T
--------------------
01-MAR-2005 19:15:26

SQL>








13.2.ADD_MONTHS
13.2.1.ADD_MONTHS(x, y) gets the result of adding y months to x.
13.2.2.Subtract 13 months from the January 1, 2005
13.2.3.Combine ADD_MONTHS() function with To_Date
13.2.4.Combine ADD_MONTHS() with TO_CHAR() and TO_DATE
13.2.5.SELECT ADD_MONTHS('28-NOV-05', 1) FROM DUAL;
13.2.6.SELECT ADD_MONTHS('29-NOV-05', 1) FROM DUAL;
13.2.7.SELECT ADD_MONTHS('30-NOV-05', 1) FROM DUAL;
13.2.8.SELECT ADD_MONTHS('31-DEC-05', -1) FROM DUAL;
13.2.9.SELECT ADD_MONTHS('01-JAN-2005', 3) FROM dual;
13.2.10.SELECT ADD_MONTHS('01-JAN-2005', -3) FROM dual; (2)
13.2.11.Add Negative time