Union queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Are union queries useful? Can it be done using other kinds of queries in two
steps?
 
Union queries are very useful. No, you cannot replicate their results using
two "steps" unless you build a table with one of those steps and then fill
that table with the results of individual queries.
 
Can I create union queries in design view using type of query or must it be
written in sql?

ALso, can you give me an ex. of where a union query would be needed and why
it could not be acheived with 2 queries instead?

Thanks
 
Union queries cannot be created in the "grid" design view for a query. They
must be created in SQL view.

The whole purpose of union queries is to combine the records from two or
more queries, such that you get a single query as the result. I'm not sure
how to explain it better than that. For example, suppose you have two
queries that return two fields from a single table each:

SELECT Field1, Field2
FROM Table1;

and

SELECT Field1, Field2
FROM Table2;

You can run these queries independently and get the records from the query,
but only one a time. In a union query, you can combine the two queries'
output into a single query:

SELECT Field1, Field2
FROM Table1
UNION
SELECT Field1, Field2
FROM Table2;
--

Ken Snell
<MS ACCESS MVP>
 

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

Back
Top