amthorpe2000
New Member
- Joined
- Aug 29, 2009
- Messages
- 8
I have 3 tables which are imported from Excel. Each table has many columns but 3 are consistent (team, month, value).
1st i want to get the distinct / unique combinations accross all 3 tables for the team and month, which i did with a union query (I think)
but then I want the sum of the value from each of the 3 tables against the unique combination. So each table may have 1000's of records, which i want to end up with the query results in the right hand red set in the image
Everything i try comes up with data mismatch or produces 100's more entries than the original.
Any help appreciated
1st i want to get the distinct / unique combinations accross all 3 tables for the team and month, which i did with a union query (I think)
SQL:
SELECT team, period
FROM Table3
UNION SELECT team, period
FROM Table1
UNION SELECT team, period
FROM Table2
ORDER BY team, period;
but then I want the sum of the value from each of the 3 tables against the unique combination. So each table may have 1000's of records, which i want to end up with the query results in the right hand red set in the image
Everything i try comes up with data mismatch or produces 100's more entries than the original.
Any help appreciated