Access: Union Query Example - Create Mail List From Two Different Tables
If you need to send the same letter to people listed in two different database tables, you don't have to create two different mailing lists. You can use Microsoft Access's Union query to combine the two tables into one list.
Example:
suppose you want to send the same letter to all your company accounts and the interns working on those accounts. The Customer database contains the name of each company in the Name field. The Intern database contains the name of each Intern in two fields, Last Name and First Name. You want the results of the Union query to combine the Name fields from both databases into one Mailing Name field. The Intern table's Mailing Name field is a combination of the Last Name and First Name fields and the Customer table's Mailing Name field comes from the Name field, renamed Mailing Name.
And this is how we do it::
1. In the Database window, click Queries under Objects and then click New.
2. Double-click the Design View.
3. Click Close.
4. Go to Query | SQL Specific | Union.
5. Enter the following code at the prompt:
SELECT [First Name] & " " & [Last Name] As [Mailing Name], [Address], [City],
[State], [Zip Code]
FROM Intern
UNION SELECT [Name] As [Mailing Name], [Address], [City], [State], [Zip Code]
FROM Customer;
6. Click Run on the Query toolbar.
The Union query results contain both the interns' and companies' names and addresses.
If you require additional information or assistance with this item, please give us a call.
- Printer-friendly version
- Log in to post comments


