How to collect data from many queries to 1 query?

  • Thread starter Thread starter vukas
  • Start date Start date
V

vukas

hello,
I have 12 tables with common field "Employee Name" (duplicates OK). Every
table contains different type of records (salaries, bonuses, extra money and
etc.), every record has its own date and other variables.
I made one query for each table, which summarizes all records in numeric
fields (currency) for each employee according to many complex criterias. So
now I have 12 queries with "Employee Name" and "Total per employee".

How to get list of grand totals for every employee from these 12 queries?
These totals will be included to calculations in other queries.

Thank You!
Deivis
 
Hi,



SELECT 1 As queryFrom, f1, f2, f3, ... FROM query1
UNION ALL
SELECT 2, f1, f2, f3, ... FROM query2
.....
UNION ALL
SELECT 12, f1, f2, f3, ... FROM query12



will merge the result of the twelve queries (even keeping the query the row
comes from). Save it, say, under QU.

Make a total query using QU as if it was a table.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top