Wednesday, April 20, 2011

How to add month in oracle

SELECT ADD_MONTHS('01-Aug-03', 3) FROM dual;
returns '01-Nov-03'

SELECT ADD_MONTHS('01-Aug-03', -3) FROM dual;
returns '01-May-03'

SELECT ADD_MONTHS('21-Aug-03', -3) FROM dual;
returns '21-May-03'

SELECT ADD_MONTHS('31-Jan-03', 1) FROM dual;
returns '28-Feb-03'

No comments:

Post a Comment