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: Selecting records by the Time of a Date column

Re: Selecting records by the Time of a Date column

From: Gary SMITH <Gary.Smith_at_cern.ch>
Date: Thu, 30 Apr 1998 10:43:27 +0200
Message-ID: <354839AF.CDBB479A@cern.ch>


I would prefer:

Select * from MyTable Where MyDate > to_date('12:30', 'HH24:MI')

Whenever you are doing date comparisons you should keep both sides of the expression as dates and not chars.

Regards

Gary Smith

Paul Koppens wrote:

> Hi Mikel,
>
> try:
>
> Select * from MyTable Where TO_CHAR(MyDate, 'HH24:MI') > '12:30'
>
> good luck,
>
> Paul.
>
> Mikel Bengoa <miksil_at_jet.es> wrote in article
> <01bd73aa$5165c2e0$d39d37c3_at_pcmikel>...
> > Hi,
> >
> > I have a table with a column that is a "Date" and I would like to get a
> set
> > of records with the condition that the time part of this date is greater
> > than a Value.
> >
> > I would like to do something like that:
> >
> > Select * from MyTable Where MyDate> '12:30'
> >
> > It does not work. How can I get it. Is there any function to get the time
> > from a date?
> >
> > Thanks in advanced
> >
> > Mikel
> >
> >

--



Gary Smith
CERN, Geneva, Switzerland
Email: Gary.Smith_at_cern.ch
Tel: +41 22 7678944
Received on Thu Apr 30 1998 - 03:43:27 CDT

Original text of this message

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