Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Adding 1900 years to a date

Re: Adding 1900 years to a date

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 30 Aug 2004 19:59:44 GMT
Message-ID: <slrncj71pb.c0.rene.nyffenegger@zhnt60m34.netarchitects.com>


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(



21-sep-1976

Hth
Rene

-- 
  Rene Nyffenegger
  http://www.adp-gmbh.ch/
Received on Mon Aug 30 2004 - 14:59:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US