Create union query

  • Thread starter Thread starter shiro
  • Start date Start date
S

shiro

Hi All,
I 'm a newbie in access and still confuse with union query.
Would somebody like to provide or create a simple sample
for me so that I can see how does it work.

Thank's at all

Shiro.
 
Shiro,

The following is the Nth Union query statement taken from Access Help:

query1 UNION [ALL]
query2 [UNION [ALL]
queryn [ ... ]]


That probably looks a bit funny so here's a sample, also taken from Access
Help:

TABLE [New Accounts] UNION ALL
SELECT *
FROM Customers
WHERE OrderAmount > 1000;

The union query above merges all records in the table New Accounts with only
records from the table Customers that have an OrderAmount over 1000.

Please take note that all union queries must request/return the same number
of fields. In other words, you can't union a table with 2 fields with a table
with 3 fields. However, they do not have to be the same size or data type.
 

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 4
UNION QUERY 2
Union Query and Field Alias 7
Comlex union query question 4
Union query 5
Union Queries - Record Formatting 1
Union Query if Yex/No 13
Union query not displaying select statement 1

Back
Top