combining names

J

JohnE

I have 2 tables (tableA, tableB) that have names in them. I would like to
combine the name field from each table to create a full list of names coming
from both tables. I am at a loss on this. Seeking the advice of someone who
can get me started.
Thanks.
***John
 
J

JohnE

If any one reads this, never mind. I got it figured out. Thanks for taking
the time to look at this posting.
*** John
 
T

Ted Allen

Hi John,

You can do this with a UNION query. You have to switch to sql view to
create one, but it is pretty simple. The syntax is as follows:

SELECT TableA.YourNameField As YourAlias FROM TableA
UNION
SELECT TableB.YourNameField FROM TableB
ORDER BY YourAlias;

Of course, you would have to substitute your actual field names in place of
"YourFieldName". The "As YourAlias" part is optional, but that's how you
would provide a column name different from the TableA field name. The ORDER
BY part is also optional, but if included should be placed after the last
SELECT statement, and should use the field name(s) (or alias if used) from
the first SELECT.

HTH, Ted Allen
 
Top