[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Sorting (Order by) in SQR



It sounds like the field in the database is a char field.  If you're using
an oracle database, try

order by
     decode(nvl(field_name,'X'),'X',0,to_number(field_name))

This is assuming that there are only numeric values and the occasional null
value in the field.

Ray

> -----Original Message-----
> From: Hallmark, Robert J [mailto:robert.j.hallmark@LMCO.COM]
> Sent: Friday, May 19, 2000 10:16 AM
> To: SQR-USERS@list.iex.net
> Subject: Sorting (Order by) in SQR
>
>
> Is anyone aware of a way to get an actual numerical sort in SQR?
> For example, If I do an order by on a numerical field it
> currently sorts as
> follows:
>
> 1
> 123
> 21
> 212
> 35
> 4
>
> Is there a way to get it to sort as follows:
>
> 1
> 4
> 21
> 35
> 123
> 212
>
>
> Thanks
>
>
> Bob
>