Message-Id: <10735.126063@fatcity.com> From: Jacques Kilchoer Date: Mon, 8 Jan 2001 14:01:24 -0800 Subject: RE: Date comparison question This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C079BE.8B0A7780 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Lisa Yates [mailto:cosnit@creighton.edu] > Sent: lundi, 8. janvier 2001 11:27 >=20 > Why doesn't this query ever return... >=20 > where run_date =3D to_date('01-03-2001 16:34:59','mm-dd-yyyy=20 > hh24:mi:ss') >=20 > but this query does.... >=20 > where to_char(run_date) =3D to_char(to_date('01-03-2001 > 16:34:59','mm-dd-yyyy hh24:mi:ss')) >=20 > and so does this query.... >=20 > where to_char(run_date,'mm-dd-yyyy hh24:mi:ss') =3D '01-03-2001=20 > 16:34:59' Well, I guess my suggestion that run_date may contain a "BCE" (before = common era) date was not the answer to your problem. Maybe I misunderstood the issue. When you say "why doesn't the query ever return", do you mean it returns zero rows, or do you mean that the query is taking an = abnormally long time? If it's taking an abnormally long time, an explain plan on = the two queries may reveal the cause. Jacques R. Kilcho=EBr (949) 754-8816 Quest Software, Inc. 8001 Irvine Center Drive Irvine, California 92618 U.S.A. http://www.quest.com ------_=_NextPart_001_01C079BE.8B0A7780 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: Date comparison question

> -----Original Message-----
> From: Lisa Yates [mailto:cosnit@creighton.edu]
> Sent: lundi, 8. janvier 2001 11:27
>
> Why doesn't this query ever return...
>
> where run_date =3D to_date('01-03-2001 = 16:34:59','mm-dd-yyyy
> hh24:mi:ss')
>
> but this query does....
>
> where to_char(run_date) =3D = to_char(to_date('01-03-2001
> 16:34:59','mm-dd-yyyy hh24:mi:ss'))
>
> and so does this query....
>
> where to_char(run_date,'mm-dd-yyyy hh24:mi:ss') = =3D '01-03-2001
> 16:34:59'

Well, I guess my suggestion that run_date may contain = a "BCE" (before common era) date was not the answer to your = problem. Maybe I misunderstood the issue. When you say "why = doesn't the query ever return", do you mean it returns zero rows, = or do you mean that the query is taking an abnormally long time? If = it's taking an abnormally long time, an explain plan on the two queries = may reveal the cause.

Jacques R. Kilcho=EBr
(949) 754-8816
Quest Software, Inc.

8001 Irvine Center Drive
Irvine, California 92618
U.S.A.
http://www.quest.com