Hello, I found a way to do this:
Candy Table 1
FlavorID Amount
lemon 1
orange 2
Candy Table 2
FlavorID Amount
orange 2
apple 1
I can generate Candy Table 3 now:
FlavorID Amount
lemon 1
orange 4
apple 1
I found a way to do this. It is an unsupported SQL statement that goes:
SELECT FlavorID, Sum(Amount) AS SumOfAmount
FROM
I am sure this subject has been covered multiple times in the past, but I was unsuccessful to find the right thread. This solution was an improvisation on the many advice about the subject, and l consider myself to have amateur's luck to have figured it out myself.
My question is, is this the proper way to obtain Table 3? Or are there cleaner/more efficient (preferably supported by access query editor) ways to do it?
Candy Table 1
FlavorID Amount
lemon 1
orange 2
Candy Table 2
FlavorID Amount
orange 2
apple 1
I can generate Candy Table 3 now:
FlavorID Amount
lemon 1
orange 4
apple 1
I found a way to do this. It is an unsupported SQL statement that goes:
SELECT FlavorID, Sum(Amount) AS SumOfAmount
FROM
(SELECT Table1.FlavorID, Table1.Amount
FROM Table1
UNION ALL
SELECT Table2.FlavorID, Table2.Amount
FROM Table2)
GROUP BY FlavorIDFROM Table1
UNION ALL
SELECT Table2.FlavorID, Table2.Amount
FROM Table2)
I am sure this subject has been covered multiple times in the past, but I was unsuccessful to find the right thread. This solution was an improvisation on the many advice about the subject, and l consider myself to have amateur's luck to have figured it out myself.
My question is, is this the proper way to obtain Table 3? Or are there cleaner/more efficient (preferably supported by access query editor) ways to do it?
Last edited: