Union Query

M

mark

You're not real clear as to what you're trying to
accomplish, so I cannot say for sure whether a Union query
will do the job for you. Assuming it will, the syntax is
pretty straightforward:
Select x, y, z, null, null
From TableA
Where [criteria]
Union
Select a, b, c, d, e
From TableB
Where [criteria]

In a union query, you need to have the same number of
fields selected in both parts of the union. In this
example, we are selecting 5 fields from table B and only 3
from A, so we insert 'null' in place of the non-existent
fields in order to "match" the 5 fields.

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 and Field Alias 7
Union query 5
Union Query 1
SUM in a UNION query 2
Comlex union query question 5
Duplicates in union query 3
Union Query Edit 1
UNION question 3

Top