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: A really strange problem

Re: A really strange problem

From: Tim Cross <tcross_at_pobox.une.edu.au>
Date: 16 Jun 2002 16:37:00 +1000
Message-ID: <87elf720hf.fsf@blind-bat.une.edu.au>


"Sergey M" <msu_at_pronto.msk.ru> writes:

> Hello!
>
> "Ilya Shambat" <ishambat_at_aol.com> wrote in message
> news:d02408fc.0206131235.2cabf009_at_posting.google.com...
> >
> > SQL> select * from casetext
> > 2 where createdate = '13-JUN-02';
>
> Try this query: select * from casetext where trunc (createdate) = to_date
> ('13-JUN-02', 'dd-mon-rr');
>

I think you need to be careful with the above example. If your db has an index on createdate it won't be used because putting a function on a column will cause oracle to skip any indexes it could use.

It is likely you are not getting any rows returned because you are really comparing with 13-JUN-2002 00:00:00. Maybe you could use

where createdate >= to_date('13-JUN-02', 'DD-MON-YY') and createdate < to_date('14-JUN-02', 'DD-MON-YY');

Tim Received on Sun Jun 16 2002 - 01:37:00 CDT

Original text of this message

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