473,288 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

General sort order

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
2 7719
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: its me | last post by:
Let's say I have a class of people... Public Class People Public Sex as String Public Age as int Public Name as string end class And I declare an array of this class...
2
by: One's Too Many | last post by:
Ran into a strange problem today: 8.1.7 on AIX 4.3.3 Database and applications had been working fine for two years and all of a sudden a couple of regularly-run queries are now no longer...
39
by: Antoon Pardon | last post by:
I was wondering how people would feel if the cmp function and the __cmp__ method would be a bit more generalised. The problem now is that the cmp protocol has no way to indicate two objects are...
7
by: Steve Crawford | last post by:
I am suffering some sort order confusion. Given a database, "foo", with a single character(4) column of data left padded with spaces I get: select * from foo order by somechars; somechars...
5
by: Jan Smith | last post by:
I've searched the overloads for the Array.Sort method, and I haven't found a clear answer to my question. Maybe it's not in Array.Sort. Here's the question: I initialize an array X with the...
2
by: Patrick | last post by:
I got a page that loads a xml file into a treeview control. I want it to sort the data before sending it to the treeview control is that possible? <root> <level1 name="" src="" order="0">...
6
by: weetat.yeo | last post by:
Hi all , I have sql statement below , SELECT serial_no,host_name,chasis_model,chasis_flash_size,chasis_dram_size,...
15
by: bcochofel | last post by:
Hi, I want to use a variable to sort elements. That var his passed with query string (I'm using Perl CGI to generate XML). Here's a sample of my output:...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.