Peter Herijgers
2008-11-19 15:39:23 UTC
Hi All,
Currently I am using MSDE.
If I want to order some items the output makes no sense to me.
I have a table with 3 records.
Each record has a column (varchar data type), which holds 1, 880 and 2200.
Using SELECT SomeField FROM MyTable ORDER BY SomeField
The records are sorted like this 1, 2200, 880.
I can overcome this problem by using this
SELECT CAST(ItemNo AS int) FROM MyTable ORDER BY CAST(ItemNo AS int)
Any ideas why the first SQL Query is not working?
Is this a known problem of MSDE?
Later this year I want to upgrade to SQL 2008.
Thanks in advance.
Peter
Currently I am using MSDE.
If I want to order some items the output makes no sense to me.
I have a table with 3 records.
Each record has a column (varchar data type), which holds 1, 880 and 2200.
Using SELECT SomeField FROM MyTable ORDER BY SomeField
The records are sorted like this 1, 2200, 880.
I can overcome this problem by using this
SELECT CAST(ItemNo AS int) FROM MyTable ORDER BY CAST(ItemNo AS int)
Any ideas why the first SQL Query is not working?
Is this a known problem of MSDE?
Later this year I want to upgrade to SQL 2008.
Thanks in advance.
Peter