Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie SQL on date data type column
Don't assume a format. You are comparing a string format with a date and
thus having Oracle use an implicit conversion. Try this:
Select *
From ServTime
Where starttime between to_date('2003-01-29 08:00:00','yyyy-mm-dd
hh24:mi:ss') and
to_date('2003-01-29 12:00:00','yyyy-mm-dd hh24:mi:ss')
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Jay" <jlee00_99_at_yahoo.com> wrote in message news:3ea71bf0.0301311937.1fe537b8_at_posting.google.com...Received on Fri Jan 31 2003 - 22:39:09 CST
> I am experiencing a problem with my simple SQL. I am getting an error
> message stating that the month is not recognized. What changes do I
> need to make to my query?
>
> Select *
> From servtime
> Where starttime between '2003-10-29 09:00:00' and '2003-10-29
> 12:00:00'
>
> The data type for for the starttime column is DATE. The values in
> this column appear in this format YYYY-MM-DD HH:MM:SS
>
> Any pointers would be greatly appreciative.
>
> Thanks,