Selasa, 03 Juni 2014

[MS_AccessPros] Sorting with a union query

 

I am attempting to make a union query that will provide an
alphabetical listing of residents.

The SQL is below. The error message says that I must use the same
fields in the ORDER BY expression. That is not possible.

Is there a way around my problem?

There are more 'ResidentStatus' fields to include if I overcome the
first problem.

Many thanks,

Robin Chapple

SELECT Telephone.Unit, [fLastName] & " " & [fFirstName] AS Resident,
Telephone.Phone
FROM Telephone
WHERE (((Telephone.ResidentStatus)=4))
ORDER BY [fLastName] & " " & [fFirstName];

UNION SELECT Telephone.Unit, [mLastName] & " " & [mFirstName] AS
Resident, Telephone.Phone
FROM Telephone
WHERE (((Telephone.ResidentStatus)=4))
ORDER BY [mLastName] & " " & [mFirstName];

__._,_.___

Posted by: Robin Chapple <robinski@westnet.com.au>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

.

__,_._,___

Tidak ada komentar:

Posting Komentar