Oracle/PLSQL: Add_Months Function
--------------------------------------------------------------------------------
In Oracle/PLSQL, the add_months function returns a date plus n months.
The syntax for the add_months function is:
add_months( date1, n )
date1 is the starting date (before the n months have been added.
n is the number of months to add to date1.
For example:
add_months('01-Aug-03', 3) would return '01-Nov-03'
add_months('01-Aug-03', -3) would return '01-May-03'
add_months('21-Aug-03', -3) would return '21-May-03'
add_months('31-Jan-03', 1) would return '28-Feb-03'
2007-05-17
15:08:52
·
2 answers
·
asked by
nick
1
in
Computers & Internet
➔ Programming & Design