Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Ordering by a number, date or text
>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
Received on Thu Mar 08 2001 - 07:23:19 CST
![]() |
![]() |