G
Guest
I wish to sort a list of names alphabetically in access. How do I keep names
Starting with Mac and Mc together or sequential?
Starting with Mac and Mc together or sequential?
I wish to sort a list of names alphabetically in access. How do I keep names
Starting with Mac and Mc together or sequential?
Could you give an example of such a list? I'd suggest just sorting the
LastName field alphabetically; all the Mac names (including non-Celtic
names like Mach, Machado, Macciato, etc.) will sort together, as will
all the Mc names. What would you want that's different?
McFarlane to follow immediately after MacFarlane, McLeod with MacLeod
McLeod, Paul
MacLeod, Peter
McLeod, Petronella
MacLeod, Pricsilla
McFarlane to follow immediately after MacFarlane, McLeod with MacLeod
McLeod, Paul
MacLeod, Peter
McLeod, Petronella
MacLeod, Pricsilla
Please sort the following names into correct order then:
MacGee
McGee
Mach
Machado
MacHeath
McHeath
Machinery
That quibble aside: use this calculated field for sorting.
SortName: IIF(Left([LastName], 3) = "Mac", "Mc" & Mid([LastName], 4),
[LastName])
This will sort all the Mc and all the Mac names as if they were Mc but
display them as entered. Note that non-patronymic names which happen
to begin with the letters "Mac" will be sorted incorrectly, but that's
what you're asking for.
John Vinson said:McFarlane to follow immediately after MacFarlane, McLeod with MacLeod
McLeod, Paul
MacLeod, Peter
McLeod, Petronella
MacLeod, Pricsilla
Please sort the following names into correct order then:
MacGee
McGee
Mach
Machado
MacHeath
McHeath
Machinery
That quibble aside: use this calculated field for sorting.
SortName: IIF(Left([LastName], 3) = "Mac", "Mc" & Mid([LastName], 4),
[LastName])
This will sort all the Mc and all the Mac names as if they were Mc but
display them as entered. Note that non-patronymic names which happen
to begin with the letters "Mac" will be sorted incorrectly, but that's
what you're asking for.
John W. Vinson[MVP]
Thanks - that is what I was asking for...
I do not have any subscribers called "machinery" or mach etc
I simply do NOT see what benefit you accrue from such a nonstandard
sorting! Would a subscriber named MacLaren really object to being in
an alphabetical list, or would the really prefer to be next to
McLaren? Why do you feel this is needed!?
Works well if the
list is being sorted by a Scot, less well if by a computer that thinks
MacH is a clan of German scientists!