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: Comparing DATE with TIMESTAMP fields possible ?

Re: Comparing DATE with TIMESTAMP fields possible ?

From: Dave <x_at_x.com>
Date: Thu, 10 Feb 2005 00:00:48 GMT
Message-ID: <QuxOd.11027$8B3.4612@text.news.blueyonder.co.uk>

"George Dainis" <george.dainis_at_bluecorner.com> wrote in message news:cue1up$k5b$01$1_at_news.t-online.com...
> In my database table there is a datetime column which can obviously
> contain a timestamp
> (in the format YYYY-MM-DD HH:MM:SS.NNN).
>
> Now I want to get all those records which have a date of lets say
> 2005-02-03 regardsless of
> their time value.
>
> Ok, I could do this by statement like
>
> SELECT * FROM MYTAB WHERE MYDATE >= '2005-02-03 00:00:00.000' AND MYDATE
> <= '2005-02-03 23:59.59.999'
>
> but this is rather inconvenient. I feel that there must be a shorter
> version like
>
> SELECT * FROM MYTAB WHERE MYDATE = '2005-02-03 **:**:**.***'
>
> or a built-in fuction like:
>
> SELECT * FROM MYTAB WHERE datepartonly(MYDATE) = '2005-02-03'
>
> How does this work?
>
> George
>
Received on Wed Feb 09 2005 - 18:00:48 CST

Original text of this message

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