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