Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Ordering by a number, date or text

Re: Ordering by a number, date or text

From: Ted Knijff <knijff_at_bigfoot.com>
Date: Thu, 08 Mar 2001 19:29:32 GMT
Message-ID: <3aa7dc1c.30878621@news.online.de>

If you want to sort on the hours in date try :  .... trunc(wdate,'HH24'). This will sort on date+hours. If you want the hours only and don't care about the date, try :  ... substr(to_char(wdate,'HH24'),1,2)

Hth.

On Thu, 8 Mar 2001 08:23:19 -0500, "roy fells" <molson_c_at_hotmail.com> wrote:

>
>>Try TO_NUMBER() and see if it solves the problem.
>
>
>Thanks for the suggestion, I tried it, I also tried a to_date with my date
>to see if either would work, unfortunately it did not work. I was thinking
>of using order by len then order by standard hours (or whatever other number
>my criteia were but that would not work as I have 1/4, 1/2 & 3/4 hour
>increments as well. so the 45 minutes (ie .75 hrs) would come after 1 hour
>:( . If anyone can think of another way around this I would really
>appreciate it.
>
>Below is my code
>
>order by DECODE(:types, 'names', DECODE(:names, 'fullname', fullname,
>'task', task, 'subtask', subtask, account_name), 'nums', TO_NUMBER
>(DECODE(:nums, 'st', st, 'ot', ot, dt)), TO_DATE(wdate))
>
>fullname, task, subtask, account_name are all characters (length 40) (more
>then i need but anyway)
>st, ot, dt are all numbers
>wdate is of course a date
>
>

EMail: knijff_at_bigfoot.com Received on Thu Mar 08 2001 - 13:29:32 CST

Original text of this message

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