Hi Adrian,
Why don't you set column's DataType to a numeric one (I guess you have it
set to string now).

Signature
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
> When I sort a number I get a lexicographical sort
> 1
[quoted text clipped - 6 lines]
>
> Adrian.
Adrian - 31 Aug 2006 12:13 GMT
> Why don't you set column's DataType to a numeric one (I guess you have it
> set to string now).
Miha,
Yes, but more generally I was looking for an expression like
VALUE([column name]) in a SQL command line.
Adrian.
Miha Markic [MVP C#] - 31 Aug 2006 12:58 GMT
Hi,
So you want to do sorting on database. What database?

Signature
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>> Why don't you set column's DataType to a numeric one (I guess you have it
>> set to string now).
[quoted text clipped - 5 lines]
>
> Adrian.
Adrian - 31 Aug 2006 13:10 GMT
> So you want to do sorting on database. What
> database?
SqlServer 2005 Express
Miha Markic [MVP C#] - 31 Aug 2006 13:46 GMT
You might use cast or convert function and sort on the result, something
like ... order by case(comecolumn as int)

Signature
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>> So you want to do sorting on database. What
>> database?
>
> SqlServer 2005 Express
Adrian - 31 Aug 2006 16:43 GMT
> You might use cast or convert function and sort on the result, something
> like ... order by case(comecolumn as int)
Great. Thank you.
Adrian
> When I sort a number
Youre sorting text, not numbers. It matters little to the computer that
the text is composed entirely of numeric characters - it's text, not a
number
> How can I code a sort that will produce
> a proper numerical order?
Use numbers, not text
Adrian - 31 Aug 2006 16:43 GMT
> Use numbers, not text
Yes, I have changed the code.
Thanks,
Adrian.