Desperatey needs help on query project

G

Guest

I have a small problem and need any advice that can be offered. I have a query that runs off of a linked table. I absolutely cannot update the linked table which is located on a server; however, I need to have the first, middle, and last names separated in the results of the query or at least sorted by last name and first name. Is there a way to separate first, middle, and last names from a query's results without doing an update query against the original linked table.

Thanks

Table - John A Smith (Input as
Query - Need to have all names sorted by last name then by first nam

For example In Linked Table Shown A
John A Smit
Mary Johnso
Carol Ann S. Brow
John B Smit

Need to be sorted a

Carol Ann S. Brow
Mary Johnso
John A Smit
John B Smith
 
M

martin

Put the following function in 1 of your public modules as
of access 2000 they dont have this or something similiar
as a function...
Public Function getlastname(name As String)
getlastname = Right$(name, InStr(1, StrReverse
(name), " ") - 1)
End Function

Then in sql builder it would be like first column
lastname:getlastname([name]) sort ascending then next
column would be whole name sort ascending.

There probably is a better way and this will not work if
there are jr. or sr. or II at the end of the name.

Martin
-----Original Message-----
I have a small problem and need any advice that can be
offered. I have a query that runs off of a linked table.
I absolutely cannot update the linked table which is
located on a server; however, I need to have the first,
middle, and last names separated in the results of the
query or at least sorted by last name and first name. Is
there a way to separate first, middle, and last names from
a query's results without doing an update query against
the original linked table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top