SOLVED: Re: Can ACE select a CHAR field and treat it as an INTEGER?
Posted in 1994
Thanks to those who wrote; the solution I ultimately ended up using
was to select the char field from the table as a mathematical expression
so that it was interpreted as a number, e.g.:
select (char_field + 0) char_field
from table
order by 1
Strangely I thought I had done this before; must have been in a past
life :) Thanks to Bhupendra Patel (bsqlbp@mash.wnhealth.co.nz).
Eric
eric@saperstein.com
Eric Thompson <thompson@netcom.com> wrote:
>I have a situation in which I'd like to select a character field
>from a table and sort it as though it were an integer. I know in advance
>that all rows returned will have numeric values, even though the field
>must remain a char field.
>
>I thought something like this should work, but it doesn't:
>
> select int(char_field)
> from table
> order by 1
>
>One inelegant method of solving this that I think might work is:
>
> select char_field
> from table
> order by char_field[1], char_field[2], ..., char_field[8]>
>But that stops working after the eighth digit.
>
>Any help is appreciated. E-mail preferred.
>
>thanks,
>
>Eric Thompson eric@saperstein.com (NeXTmail ok)
>Saperstein, Mayeda & Goldstein thompson@netcom.com