[AccessD] Sorting Alpha-Numerics

Gustav Brock gustav at cactus.dk
Tue Oct 21 09:34:49 CDT 2003


Hi Mark

You could do this SQL

 .. Order By StrComp(strVal, Cstr(Val(strVal)), 1) ASC, strVal ASC

/gustav


> Greetings,

> I have a text field containing all possible 3 digit alpha-numeric
> combinations from 000 to ZZZ.  I am looking for a method to sort this text
> field where 000 through 999 are listed in numerical order before the
> remaining alpha-numeric combinations are listed in ASCII sort order.  Any
> suggestions?  I have tried to do this in Excel, however, Excel makes some
> startling decisions on its own...such as turning 7E9 into 7000000000.

> Example:
> 000
> 001
> .
> .
> 998
> 999
> 00A
> 00B
> .
> .
> ZZZ



More information about the AccessD mailing list