Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Selecting records by the Time of a Date column
On 29 Apr 1998 20:00:17 GMT, "Mikel Bengoa" <miksil_at_jet.es> wrote:
>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
>
Select * from MyTable Where MyDate - trunc(MyDate) > ((12 * 60) + 30)/1440
This works because trunc() sets the time portion of the date value to 00:00 , and subtracting two date values gives an answer in days, so you have to convert your time (12:30) to the same units.
Eric Received on Sat May 02 1998 - 13:20:14 CDT
![]() |
![]() |