union query

  • Thread starter Thread starter Guest
  • Start date Start date
Just use the the UNION statement between 2 (or more) valid Select statments.
From the SQL design view (and it can only be done from here) type the
following (with your own parameters of course)


Select .....list of fields..... from [Table1] where......conditions......
Union
Select .....list of fields..... from [Table2] where......conditions......

Things to note:
1)You must have the same number of fields returned from each Select statment.

2)The fields must have the same data type.

Hope that helps
 
The second note is incorrect. From Access2002 Help:

"...All queries in a UNION operation must request the same number of fields;
however, the fields do not have to be of the same size or data type."
 
Have you check Access Help?

Help should always be the first source of info. since it is handy and very
quick to respond if you know what you are looking for.
 
Oh, didn't know that. I guess I've always built them so that they did.
Still learning!

Van T. Dinh said:
The second note is incorrect. From Access2002 Help:

"...All queries in a UNION operation must request the same number of fields;
however, the fields do not have to be of the same size or data type."

--
HTH
Van T. Dinh
MVP (Access)




kabaka said:
Just use the the UNION statement between 2 (or more) valid Select statments.
From the SQL design view (and it can only be done from here) type the
following (with your own parameters of course)


Select .....list of fields..... from [Table1] where......conditions......
Union
Select .....list of fields..... from [Table2] where......conditions......

Things to note:
1)You must have the same number of fields returned from each Select statment.

2)The fields must have the same data type.

Hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Union Query 3
UNION QUERY.. 3
Union query 5
Union Query 4
No Duplication or Data Suppression 3
Make table using Union Query 2
UNION OF SELECTED TABLES ONLY. 9
Data Mismatch in Excel 2010 4

Back
Top