more important---meant to include in last post--part of the same

  • Thread starter Thread starter Josh Henry
  • Start date Start date
J

Josh Henry

in that same SQL query i just provided, how would i go
about asking the query to sort on the tenants last name?

UNION Select Tenants.OccFNAme & Tenants.OccLName
From Tenants;

thanks once again?

Josh
 
You would have to include the OccLName as a separate field in the union query
and also you would need a duplicate in the first query

Select Vendors.VName AS [Payor/Payee], VName as SortOrder
FROM Vendors;
UNION
Select Tenants.OccFNAme & " " & Tenants.OccLName, OccLName
From Tenants
ORDER BY 2

OR you could do the tenants name as last name, first name

Select Vendors.VName AS [Payor/Payee]
FROM Vendors;
UNION
Select Tenants.OccLName & ", " & Tenants.OccFNAme
From Tenants
ORDER BY 1

What do you want done with Vendors? Sorted separately, in the same sort order, ???
 
Back
Top