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: How to order by hours and minutes of a date column?

Re: How to order by hours and minutes of a date column?

From: Chris Nelson <ChrisNelson_at_eaton.com>
Date: Sun, 20 Jun 1999 16:12:55 -0400
Message-ID: <376D4B47.E56C7E8D@eaton.com>


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

ORDER BY "Time"

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

Original text of this message

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