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.
 
Back
Top