Re: HELP - Ordering by Date format
From: <jl34778_at_corp02.d51.lilly.com>
Date: 13 Sep 94 20:19:20 EST
Message-ID: <1994Sep13.201920.1_at_corp02.d51.lilly.com>
Date: 13 Sep 94 20:19:20 EST
Message-ID: <1994Sep13.201920.1_at_corp02.d51.lilly.com>
In article <12a.4809.905_at_compudata.com>, barry.roomberg_at_compudata.com (Barry Roomberg) writes:
> -> SELECT .., to_char(very_tarty_column, 'DD/MM/YY HH24:MI:SS', .. .. ..
> -> where statements etc.. .. ORDER BY 2 ASC, ..;
> -> The output of the SELECT does not matter, as I can adjust the SQL
> -> results parser.
>
> Add another field which has the date without the to_char, and order by
> it
actually, you can ORDER BY any column, even if it doesn't appear in the SELECT list. So, try
SELECT ..., to_char(very_tarty_column,'DD/MM/YY HH24:MI:SS', ... ORDER BY very_tarty_column; -- Bob Swisshelm | swisshelm_at_Lilly.com | 317 276 5472 Eli Lilly and Company | Lilly Corporate Center | Indianapolis, IN 46285Received on Wed Sep 14 1994 - 03:19:20 CEST