SELECT c.Category, SUM(c.[Market Value]), SUM([p.Market Value])
FROM Dec AS c, [NOV] as p
GROUP BY c.Category
;
Tells me the category is not part of the aggregate function. I just want to see the sums of each category for both tables. I do not want only certain values to appear so should I use Join?
EDIT:
SELECT c.[Category], SUM(c.[Market Value]), SUM(p.[Market Value])
FROM Dec AS c
INNER JOIN Nov AS p ON c.ID = p.ID
GROUP BY c.category, p.Category
;
This is what I wrote using JOIN, it just runs the query for nonstop. Do I just wait? There are 80,000 rows of data, but doing one SUM grouped by category for just one month returns it instantly, why is it so hard to do two tables?
UNION ALLSUM(iif(month='Dec', [Market Value], 0)) as Dec_Value, SUM(iif(month='Nov', [Market Value], 0)) as Nov_Value. Comment back if you still have troubles