A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old August 31st, 2004, 01:09 PM
Josh Henry
external usenet poster
 
Posts: n/a
Default more important---meant to include in last post--part of the same

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

  #2  
Old August 31st, 2004, 10:06 PM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default

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, ???

Josh Henry wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Count incidences of part numbers jmdaniel Worksheet Functions 13 March 9th, 2004 05:46 PM


All times are GMT +1. The time now is 03:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.