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 time

Re: date time

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Sat, 01 Feb 2003 02:24:47 GMT
Message-ID: <PdG_9.25513$G83.498@sccrnsc04>


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.0301311715.156b1da5_at_posting.google.com...

> Hello,
>
> I am trying to query a table, but I am running into a problem with
> this simple query. I get a error message stating that the month is
> not recognized. Below is my SQL. What do I have to do to get this
> simple query to run without errors?
>
> Select *
> From ServTime
> Where starttime between '2003-01-29 08:00:00' and '2003-01-29
> 12:00:00'
>
> The values of the column starttime on the ServTime table appear
> as YYYY-MM-DD HH:MM:SS
>
> The starttime field's data type is DATE.
>
> Any pointers or suggestions would be appreciative. I don't have a
> Oracle book with me, so I'm stuck and I didn't find anything by doing
> a search on this message board concerning this problem.
>
>
> Thank You,
Received on Fri Jan 31 2003 - 20:24:47 CST

Original text of this message

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