435,098 Members | 1,893 Online
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

# General sort order

 P: n/a Hi all, I have been using letter and symbol codes such as GNU< GNU\ GNU} GNUˆ in an Access table. I was surprised to see that when the table was sorted on this field, the order is: GNUˆ GNU_ GNU} GNU< I was expecting: GNU< GNU_ GNU} GNUˆ which corresponds to the ASCII values: <(60) _(95) }(125) ˆ(136) I spent an hour searching Access Help and then MSDN for a description of "General" sort order which is the value I have set in Tools > Options > General > New Database Sort Order - without success. So I did some tests myself. I created a table of ASCII values and characters like this: ASC CHAR ____________ 32 33 ! 34 " 35 # and so on through to: 255 ÿ When this table was sorted on CHAR, I got some interesting results. As you would expect, all the letters sort together in alphabetical order: ....B b C c D d.... Further tests showed that capital and lower case letters are treated as the same letter, giving the order: "ball, Baltimore, banter, Bantu". (There is a February 1999 thread in this Newsgroup ("case sensitive sorting") which confirms this fact.) The same applies to the eleven "A" characters, which appeared as a group in my test table in the order: a(97) A(65) ª(170) á(225) Á(193) à(224) À(192) Â(194) â(226) ä(228) Ä(196) When these A's occur in strings of characters, they all sort as if they were the same "A" and it is the following character(s) which determine the order. Numbers sort in number order: 0(48) ¼(188) ½(189) ¾(190) ¹(185) 1(49) ²(178) 2(50) and so on. As for the rest (punctuation, currency, mathematical operators, etc), some patterns are discernible. Mathematical operators are grouped together: +(43) <(60) =(61) >(62) ±(177) ×(215) ÷(247) The minus sign is missing from this group but is found in another group with dashes and hyphens. The rest are all over the place. Can anyone throw any more light on this matter? How am I supposed to know what order my records are going to appear in, if Microsoft do not tell me what their General Sort Order is? Or is it there somewhere? Since there is no natural order for symbols like # * / _ } |, do we know if there was a reason for not sticking to ASCII/Unicode? Adrian Jan 9 '06 #1