Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dates
Hi,
There is a reason for this behaviour.
Try the following sql-statement
select to_char(to_date('16-SEP-99', 'dd-mon-yy'), 'dd-mon-yyyy') from dual;
As you can see, oracle converts you 99 to 2099 and that's ofcourse different than 1999.
Best regards,
Huberto
Moore <rlmoore_at_purdue.edu> schreef in berichtnieuws
Pine.SOL.4.10.10002240717530.14732-100000_at_herald.cc.purdue.edu...
> Greetings.
>
> I have been working with Oracle 7.3 after spending many months w/ SQL
> Server 6.5 and 7.0.
>
> May I say that date formats/functions etc in Oracle, well frankly, they
> suck.
>
> Any sure fire way to compare the value of a date field?
>
> I.E.
>
> The following
>
> SELECT FIELD1
> FROM TABLE
> WHERE ADATEFIELD >= TO_DATE('16-SEP-99', 'DD-MON-YY')
>
> will return different results then
>
> SELECT FIELD1
> FROM TABLE
> WHERE ADATEFIELD >= TO_DATE('16-SEP-1999', 'DD-MON-YYYY')
>
Received on Thu Feb 24 2000 - 08:03:12 CST