How do I sort my union select query results?
I have the following union select query:
SELECT Counselor
FROM Counselors
UNION SELECT StaffName
FROM tblOtherStaff
UNION SELECT CaseMgr
FROM tblCaseMgrs
UNION SELECT PsychName
FROM tblPsychs
UNION SELECT SocialWrkr
FROM tblSocWrkrs
UNION SELECT DeanName
FROM tblDeans;
These are all lists in the database that need to be maintained seperately, but which are used for list boxes as the responsible person on certain activities. Here is my problem... I've searched the database and can't figure out how to alphabetize this list for ease of use. To make matters worse, I'd like to sort on the last word in the various field names then the first word in the field names (i.e. last name then first name). They are not broken down into two fields at this point.
I have the following union select query:
SELECT Counselor
FROM Counselors
UNION SELECT StaffName
FROM tblOtherStaff
UNION SELECT CaseMgr
FROM tblCaseMgrs
UNION SELECT PsychName
FROM tblPsychs
UNION SELECT SocialWrkr
FROM tblSocWrkrs
UNION SELECT DeanName
FROM tblDeans;
These are all lists in the database that need to be maintained seperately, but which are used for list boxes as the responsible person on certain activities. Here is my problem... I've searched the database and can't figure out how to alphabetize this list for ease of use. To make matters worse, I'd like to sort on the last word in the various field names then the first word in the field names (i.e. last name then first name). They are not broken down into two fields at this point.