Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sysdate in 2000. Irritating problem..
Hi,
I've found the solution;
I used an insert script yesterday to create tables but the date format was
"dd-mon-yy". In other words Oracle recognizes it as 2082 or the like.
I got negative figures from my query. Not anymore. Have set the clock back,
run the scripts again, set the clock back to 2000. Now I get the good
results
Martin Vonk <mwvonk_at_wxs.nl> schreef in berichtnieuws
87d2li$2lip2$1_at_reader3.wxs.nl...
> Hi folks,
>
> I've a irritating problem.
> I've just encountered this problem today since I've not been involved for
> six weeks with Oracle SQL.
> In the old days (<=1999) a simple query like:
> select sysdate-entrydate from members; wen't OK.
> It displayed the number of days between to date and the entrydate of a
> member.
>
> Now in 2000 it is giving idiot results. To be more specific:
> It concerns PO815.
> I've set the NLS_DATE_FORMAT='DD-MON-RR' in init.ora and in the registry
key
> HKLM\software\oracle\HOME0 as well.
> If I execute the same query in 2000:
> select sysdate-entrydate from members; I got a lot of nonsence. Sysdate
> turns out to be 0 .
> I've tried DD-MON-RRRR as well. No luck either.
>
> However, if I execute the query:
> select to_date(sysdate,'dd-mon-rr')-to_date(entrydate,'dd-mon-rr') from
> members; than everything works fine.
>
> Live has to become easier (so less typing), not more complicated.
>
> Please, can someone explain what I'm doing wrong ???????
>
> Thanks in advance
>
> Martin Vonk
>
>
>
Received on Fri Feb 04 2000 - 13:28:06 CST
![]() |
![]() |