[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Format Date from 1999
- Subject: Re: Format Date from 1999
- From: "Neill, Craig" <cneill@THEZENITH.COM>
- Date: Wed, 26 Jan 2000 14:09:23 -0800
Since it was Oracle's default date processing that got you into trouble,
why not let it do the work of getting you out?
The following example fixes anything with a date greater than Jan 1, 2050
(modify to suit).
begin-sql
update YOUR_TABLE
set YOUR_FIELD = add_months(YOUR_FIELD ,-1200)
where YOUR_FIELD > to_date('01-JAN-2050', 'dd-mon-yyyy')
end-sql
This should work regardless of default date formats...
hope it helps..
Craig Neill
<snip>
Wayne Douglas wrote:
I wrote a program last year that would read data from a flat file that we
receive on disk, and then load selected data from the file into an
Oracle7.3.4 table. Dates were received in the MMYY format and I just copied
them over using the strtodate($str_date, 'mmyy') format.
I have now come to learn that the 'YY' format uses the current century as
the header year, and I should have been using 'RR' instead.I am now getting
reports that have a report date of 2099. My problem isthat I need to update
all the files that were posted since the start of theyear and change '2099'
to '1999'.
<snip>