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: Newbie SQL on date data type column

Re: Newbie SQL on date data type column

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Sat, 01 Feb 2003 04:39:09 GMT
Message-ID: <NbI_9.117724$AV4.3543@sccrnsc01>


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...

> 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,
Received on Fri Jan 31 2003 - 22:39:09 CST

Original text of this message

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