Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ORDER BY with alpha numerics

Author  Topic 

uberbloke
Yak Posting Veteran

67 Posts

Posted - 2001-11-01 : 08:39:26
I have a column "company_code" which is varchar(100) to hold, er, company_codes.

Now some of the codes are alpha, but some are numeric (999, 1000, 9987) and the display needs to have these codes in order ...

except, using the example above when they are ORDER BY'd I get 1000, 999, 9987 because of ascii (i think).

Using a varchar field can I get the numbers in the right order 999, 1000, 9987 using ORDER BY? (and have the alpha stuff ordered alphabetically as well?)

I have tried messing with collation but to no success.

   

- Advertisement -