Union query question

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

Guest

I would like to join two queries into one. Can this be done using a union
query? The queries have some related fields but the majority are not. One
query has 6 fields and the other has approx 9 with 3 being the same field
name but non have the exact amount of records. Both are select queries
 
Yes. Create a select query for the one with the most fields you want to
display.
Save.
Then create the next select query and add place-holder columns for those in
the first query that are not in the second. I used NULL but based on you
data you can use "" or 0 for the place holder.

Copy the SQL and paste in to the first. Remove the semicolon from the first
and add UNION ALL to the second.

SELECT ConfusedTable1.Article, ConfusedTable1.Year, ConfusedTable1.Author,
ConfusedTable1.Position
FROM ConfusedTable1
UNION ALL SELECT Null AS [Article], Null AS [Year], ConfusedTable2.Author,
ConfusedTable2.Position
FROM ConfusedTable2;

All changes will have to be made in the SQL view as it will not display in
design view.
 

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 5
SUM in a UNION query 2
Union Query with division 2
Currency Format Lost in Union Query 1
Union Query and Field Alias 7
Join on a UNION query 2
Union query? 7
Union Query 7

Back
Top