On Jun 18, 4:16 am, sonty <saurabh.zen...@gmail.com> wrote:
> You don't actually require a function to do so,
>
> try
>
> select your_date-30*number_of_months_to_remove from your_table;
>
> or something similar.
>
> Regards,
> Sonty
>
> On Jun 18, 1:32 pm, Mouhammed Iyad <iya...@gmail.com> wrote:
>
>
>
> > Nice day Dears,
>
> > I know that there is a function for add_month()
> > but is there a function or a way to remove a number of monthes from date ???
>
> > Best Regards,
> > Iyad- Hide quoted text -
>
> - Show quoted text -
Yet the supplied add_months function will also subtract months when
the number of months is negative:
SQL> select sysdate, add_months(sysdate, -4) from dual;
SYSDATE ADD_MONTH
--------- ---------
18-JUN-09 18-FEB-09
SQL>
and add_months is more reliable than having to use the usual date
arithmetic as months vary in length.
David Fitzjarrell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---