Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to order by hours and minutes of a date column?
Howdy.
You need to do a conversion on 'your_date' field, like:
SELECT column1
, column2 , TO_CHAR( your_date, 'hh24:mi:ss') "Time" FROM your_table
The TRUNC function will specifically NOT work, because that is 'truncating' the non-day portion of the date entry, namely, the hours, minutes and seconds.
Chris
Y2K wrote:
> I need to do a select and order the results by hours and minutes (from
> 1-24 and 0-59) of a date column. I tried TRUNC function but it
> doesn't seem to work. This should be an easy question, but I can't
> find it from Oracle's documentation.
>
> Can someone help? Thanks!
Received on Sun Jun 20 1999 - 15:12:55 CDT
![]() |
![]() |