the_net_2.0
Banned
- Local time
- Today, 05:01
- Joined
- Sep 6, 2010
- Messages
- 812
All,
I just noticed that Access tables do not sort special (characters) in the correct order, in binary terms. For instance, I have a table with one field as such:
Table1
AC
-C
sorting in Ascending order, 'AC' comes first then '-C'. However, 'AC' is '4143' in hex, whereas '-C' is '2D43' in hex. Obviously, when you look at that in hex, it looks backwards. Hence, the table is not sorting the values properly.
Is it sorting the values properly, but special characters are treated differently? Is it really sorting in binary? Or is the sorting just ASCII-based?
Not too keen on this subject, can someone give me a boost here for understanding this issue?
Reason - sorted data of mine goes into a system that reads binary files (made by data I produce in Access). However, if someone requests data from a specific location with a special character like "-" in it, the location is incorrect because of the sort order of the records that the binary-based mechanism is expecting. However, from an Access-based perspective, the sort order IS correct.
However, the customer uses the binary-based machine.
thanks guys!
<EDIT>
apparently, 1-byte characters (single characters) do not cause an issue. It happens with character strings that are more than 1 char long. for instance, this is the ASC sort order for one-char strings:
Table1
-
A
and that is correctly sorted, in hex. ??
I just noticed that Access tables do not sort special (characters) in the correct order, in binary terms. For instance, I have a table with one field as such:
Table1
AC
-C
sorting in Ascending order, 'AC' comes first then '-C'. However, 'AC' is '4143' in hex, whereas '-C' is '2D43' in hex. Obviously, when you look at that in hex, it looks backwards. Hence, the table is not sorting the values properly.
Is it sorting the values properly, but special characters are treated differently? Is it really sorting in binary? Or is the sorting just ASCII-based?
Not too keen on this subject, can someone give me a boost here for understanding this issue?
Reason - sorted data of mine goes into a system that reads binary files (made by data I produce in Access). However, if someone requests data from a specific location with a special character like "-" in it, the location is incorrect because of the sort order of the records that the binary-based mechanism is expecting. However, from an Access-based perspective, the sort order IS correct.
However, the customer uses the binary-based machine.
thanks guys!
<EDIT>
apparently, 1-byte characters (single characters) do not cause an issue. It happens with character strings that are more than 1 char long. for instance, this is the ASC sort order for one-char strings:
Table1
-
A
and that is correctly sorted, in hex. ??