Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Search by a specific date - how?????
Yes, that's true, except this will not allow the use of any indexes on the date column.
Chen Yongbiao wrote:
>
> Graham Leggett wrote:
>
> > Hi all,
> >
> > I am having a very frustrating time trying to convince oracle to give me
> > all the columns in a table where the date is a specific date.
> >
> > Please can someone put me out of my misery and solve the mystery of how
> > it is done.
> >
> > I was given the following, and I was told it would work. It does not (it
> > returns no rows. The date inside the query is returned from a previous
> > query, so yes there are dates in the database):
> >
> > select * from REPORT where R_REPORT_DATE =
> > TODATE('1998-02-03','yyyy-mm-dd')
> >
> > To the person who can see through what obvious error I will become
> > eternally grateful!
> >
> > Regards,
> > Graham
> > --
> > -----------------------------------------
> > graham_at_vwv.com "There's a moon
> > VWV Interactive over Bourbon Street
> > tonight...
>
> It's very easy to do that:
> select * from report
> where to_char(r_report_date,'yyyymmdd')='19980203'
Received on Fri Feb 20 1998 - 00:00:00 CST