By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 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
Share this Question
Share on Google+
2 Replies


P: n/a
adrian.chandler wrote:
[snippage]

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.
I have a minus sign, a dash and a hyphen on my keyboard, but they're all
the same key :-)

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?


For starters ASCII/Unicode sort would make it case sensitive. What you
just listed (and I unfortunately snipped now) seems very logical to me,
it would make sense to a general user, who probably doesn't have an idea
what ASCII or Unicode is. If you look at where Microsoft actually pitch
Access, it's aimed at a wider audience than just programmers.
Jan 12 '06 #2

P: n/a
General Sort Order is in the Western European code page order.

Try looking for the article "Developing International Database Applications
Using Microsoft SQL Server" in MSDN for further details, the following
extracts may be all you need to understand this though.

"Code Pages
============
A code page, or character set, defines a collection of characters, numbers,
punctuation, symbols, and special characters for a particular language.
Using a process called encoding, each character in the code page is assigned
a numeric value called a code point. Computer hardware, software, and
operating systems can then exchange information for a particular language or
for a collection of languages using these code points."

"ANSI Code Pages
================
<SNIP>
ANSI code page is a generic term used in Windows to describe a collection of
code pages used for character encoding in graphical Win32 applications and
fonts. The original Windows ANSI code page was developed for Microsoft
Windows 3.1 for use in the United States and Western Europe. This code page
has many names, including code page 1252, Latin 1, and Windows ANSI. It is
similar to an ISO standard code page called ISO 8859-1."
--

Terry Kreft

"adrian.chandler" <ad*************@Bigfoot.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi all,

<SNIP>
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 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.