Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sysdate assumes year 1900 in months_Between calculations
Hi,
I've found the solution for my problem and maybe yours.
I've installed PO804 in 2000, so for the computer it is 2000. Tables like
Emp are installed automatically, but the format of "Hiredate" is
'dd-mon-yy'. So, Oracle recognizes it as 2080.
Lesson, be aware of insert scripts
Mightbe the answer for your "probem as well"
Joe Worthington <josephwor_at_hotmail.com> schreef in berichtnieuws
87es7q$k1v$1_at_nntp9.atl.mindspring.net...
> I am comparing sysdate (now 2000) to a date field. Oracle is assuming that
> sysdate is 1900. See code below.
>
> select
> ketsTimeAcctSalesman,
> sysdate System_Date,
> ROUND(MONTHS_BETWEEN(Sysdate, ketsTimeAcctSalesman),0)
> Time_Assigned_to_Salesman
> FROM KETS_ACCT_PROFILE
> where (ROUND(MONTHS_BETWEEN(Sysdate, ketsTimeAcctSalesman),0) < 0);
>
> This code produces the following.
>
> KETSTIMEACCTSALESMAN SYSTEM_DATE TIME_ASSIG
> ------------------------------ -------------------- ----------
> 15-SEP-99 04-FEB-00 -1195
> 05-OCT-99 04-FEB-00 -1196
> 03-FEB-99 04-FEB-00 -1188
> 01-FEB-96 04-FEB-00 -1152
> 02-APR-98 04-FEB-00 -1178
> 01-JAN-99 04-FEB-00 -1187
> 01-JAN-99 04-FEB-00 -1187
>
> Any Ideas ?
>
>
>
>
Received on Fri Feb 04 2000 - 13:13:31 CST
![]() |
![]() |