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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date Query y2k

Re: Date Query y2k

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 23 Jan 2000 14:20:15 GMT
Message-ID: <86f2mv$51j$1@news.seed.net.tw>

Aaron Lauinger <aaronl_at_cannontech.com> wrote in message news:3888B896.31010D5A_at_cannontech.com...
> The following query works doesn't work after the year 2000 (it does
> before)
>
> select TO_CHAR(TimeStamp,'MM-DD-YYYY') from MyTable where
> TimeStamp >= TO_DATE('01-01-2000','MM-DD-YYYY') AND
> TimeStamp <= TO_DATE('01-02-2000','MM-DD-YYYY')
>
> Upon closer inspection, it appears as though the date
> TO_DATE('01-01-2000','MM-DD-YYYY') is greater than any
> date in the database, including dates after 1/1/2000.

Check the data in your tables.
It shows that the data in your tables are probably in the wrong century.

> The next query is the same as the first except the first date is in 1999
> and the second in 2000
>
> select TO_CHAR(TimeStamp,'MM-DD-YYYY') from MyTable where
> TimeStamp >= TO_DATE('12-31-1999','MM-DD-YYYY') AND
> TimeStamp <= TO_DATE('01-01-2000','MM-DD-YYYY')
>
> This query returns every row after 12/31/1999 since oracle is treating
> TO_DATE('01-01-2000','MM-DD-YYYY')
> as very big.

No.
What result do you anticipate?
2000/01/01 is NOT "very big".
The query returns the records in 1999/12/31 and the records in the even moment 2000/01/01 0:0:0.

> Does someone have insight as to why this is?
> btw i'm using 8.0.4.
>
Received on Sun Jan 23 2000 - 08:20:15 CST

Original text of this message

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