98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Access 2007 Forms
Access 2007 Forms
Resolved · Low Priority · Version 2007
Barry has attended:
Access Intermediate course
Access Advanced course
Access VBA course
Access 2007 Forms
What is a union query for?
RE: Access 2007 Forms
Hi Barry
The UNION query allows you to combine the result sets of 2 or more "Select" queries. It removes duplicate rows between the various "Select" statements. To create a UNION quey you have to write the SQL String manually on the SQL Window. You cannot use the design view.
Each SQL statement within the UNION query must have the same number of fields in the result sets with similar data types.
The syntax for a UNION query is:
Select field1, field2, . field_n
From tables
UNION
Select field1, field2, . field_n
From tables;
For Example:
Select Customer_Id
From Customers
UNION
Select Customer_id
From Orders;
In this example, if a Customer_Id appeared in both the Customers and Orders table, it would appear once in your result set.
The UNION query removes duplicates.
Hope this helps
Carlos
Thu 9 Apr 2009: Automatically marked as resolved.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Deleting duplicate records from a tableYou cannot delete records tables where there duplicate records. A way around this is to create a new table which wont hold the duplicates. and then deleting the old table. |