Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Select Statement with Date

Re: Select Statement with Date

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Tue, 02 Jul 2002 18:01:32 +0100
Message-ID: <3D21DC6C.48C8@yahoo.com>


Christian Wall wrote:
>
> Hallo,
>
> I've got the following Problem:
> We have a Database, with the Fields "Personnelnumber", "EntryDate" and
> "StartTime", etc.
>
> The Type of the Fields "EntryDate" and "StartTime" is DATE
> The Primaryindex is on "Personnelnumber", "EntryDate" and "StartTime".
> Now when I try the SQL Statement
>
> SELECT * FROM ATIMES WHERE
> Personnelnumber='CW' AND
> EntryDate=To_Date('27.06.2002', 'DD.MM.YYYY') AND
> StartTime=To_DATE('15:21:00', 'hh24:mi:ss')
>
> I become no Records but when I Try
>
> SELECT * FROM ATIMES WHERE
> Personnelnumber='CW' AND
> EntryDate=To_Date('27.06.2002', 'DD.MM.YYYY')
>
> I got Records, and there is a Record with '01.01.3000 15:21:00'.
>
> What can I do if I only want to Select the Time of the Field???
>
> Thanks Chris!

Your

StartTime=To_DATE('15:21:00', 'hh24:mi:ss')

will use the current day (since you have not specified one).

hth
connor

-- 
==============================
Connor McDonald

http://www.oracledba.co.uk

"Some days you're the pigeon, some days you're the statue..."
Received on Tue Jul 02 2002 - 12:01:32 CDT

Original text of this message

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