It can be done with some code ...
Public Function TrimArticle(ByVal strInput As String) As String
Select Case True
Case UCase$(Left$(strInput, 2)) = "A "
TrimArticle = Mid$(strInput, 3)
Case UCase$(Left$(strInput, 3)) = "AN "
TrimArticle = Mid$(strInput, 4)
Case UCase$(Left$(strInput, 4)) = "THE "
TrimArticle = Mid$(strInput, 5)
Case Else
TrimArticle = strInput
End Select
End Function
.... and a query ...
SELECT TrimArticle([TestText]) AS Trimmed
FROM tblTest
ORDER BY TrimArticle([TestText]);
Sorting on a calculated column like this is not very efficient. It would be
more efficient to enter the data as, for example, "Addams Family, The", and
index the column. Or, if you prefer, use two columns, one for the article
and one for the rest of the title. That way, you can concatenate them back
together again for display purposes, for example, in a query:
FullTitle:[Article] & " " & [Title]. If this is a personal collection, the
difference may not be noticeable. If you were managing the inventory of a
library or store, though, it could be significant.
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.