Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Adding 1900 years to a date
In article <MPG.1b9d84434264ec58989ccf_at_news.individual.net>, Jeremy wrote:
> Have a load of dates in an 8i (8.1.7.2) database inadvertently loaded as
> e.g.
>
> 21-sep-0076
>
> i..e with the wrong century. What is quickest way of adding the 1900
> years to each of these?
Use add_months(...):
RENE_at_ora10> alter session set nls_date_format='dd-mon-yyyy';
Session altered.
RENE_at_ora10>
RENE_at_ora10> select add_months(to_date('21-sep-0076'),1900*12) from dual;
ADD_MONTHS(
Hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Mon Aug 30 2004 - 14:59:44 CDT