Re: Sort ignores apostrophe



Why indeed, Ed. (You should see what they did to hypens, where are now
sorted/matched inconsistently, depending on whether the field is indexed.)

Could you use the Replace() function to replace the single quote with a
space or other symbol, e.g.:
ORDER BY Replace([Surname], "'", "@")

It will kill the indexing, so hopefully we are not talking about too many
thousands of records here. If it is a real phone book, you might need to add
another field containing the actually sorting string, and index it.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Ed Adamthwaite" <adamedSpamMe@xxxxxxxxxxxxxxxx> wrote in message
news:OJN76taDGHA.916@xxxxxxxxxxxxxxxxxxxxxxx
> Hi all,
> When I do a sort on a surname field, it appears as though the apostrophe
> is specifically excluded from a sort in SQL. For example, O Dea comes
> before Oates but O'Dea comes after. If I do a typo and use a double-quote,
> O"Dea comes before Oates.
> space = ASCII 32
> double quote = ASCII 34
> single quote = ASCII 39
> O = ASCII 79
> I look to the sky and plaintively cry "Why? o Microsoft, why?"
> Is there a way to do a sort that mimics the ordering in a phone book?
> (We'll ignore "Macs" for the moment).
> Regards,
> Ed.


.



Relevant Pages

  • Re: Sort ignores apostrophe
    ... If the database is really large, this would be a reason to move to MSDE. ... > Could you use the Replacefunction to replace the single quote with a ... >> is specifically excluded from a sort in SQL. ... >> double quote = ASCII 34 ...
    (microsoft.public.access.queries)
  • Re: Sort ignores apostrophe
    ... > Could you use the Replacefunction to replace the single quote with a ... rather than allenbrowne at mvps dot org. ... >> is specifically excluded from a sort in SQL. ... >> double quote = ASCII 34 ...
    (microsoft.public.access.queries)
  • Sort ignores apostrophe
    ... When I do a sort on a surname field, it appears as though the apostrophe is ... Oates but O'Dea comes after. ... double quote = ASCII 34 ...
    (microsoft.public.access.queries)
  • Re: Sort ignores apostrophe
    ... Win32 does so for ' and -. ... > is specifically excluded from a sort in SQL. ... > double quote = ASCII 34 ... > single quote = ASCII 39 ...
    (microsoft.public.access.queries)
  • Re: Sort collating sequence
    ... 2/ It uses two sorting modes - the sort mode of the user or another which I ... > The out of sequence use of the "_" character is probably a Microsoftism -> this lets you force a directory or filename to be sorted before> similar named ones in directory/folder views. ... NO, I don't think it's that, because the underscore is also> collated before digits, which is way out whack with ASCII. ...
    (microsoft.public.windowsxp.help_and_support)

Loading