Combine Queries. Is it possible?

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

Guest

I have two complicated queries that I need to join together in a report or
output to Excel. How would I go about this without using one as a subreport?
I need fields from both queries within my detail section and other areas of
my report. Is there another way around this? I need to export these queries
to Excel utilizing there report structure. Most of the fields in both queries
are different so a Union query is out of the question. Please help if you can.
 
You can join the queries in a third query.
You can union even if the fields are different by inserting an alias like
this --
SELECT A.name, "a" AS Section, A.[section a] as Amount
FROM A
UNION SELECT B.name, B.Section, 0 AS Amount
FROM B;
 
Can you not formulate a left or right join to return the relevant fields? I
don't think that Access supports outer joins. Otherwise, you might create a
temporary table that is populated by the queries in the structure that you
want.
 
Back
Top