Hey guys need your help here. I will go ahead and describe my problem and what i intend and what i am getting.
Platform for SQL Queries : MS Access
There are 2 identical table in terms of table structure, they contain information ( RAW Data) about month, money i spent in that month and for what thing i spent my money on.
Now what i want to do is compare these two tables and subtract total value spent.
1st table has data from year 2005
2nd table has data from year 2006
The response i am getting is actually adding "Total Value" multiple times. How do i go about this ?
SELECT s2.[Month],SUM(s2.[Total Value]), SUM(d.[Total Value]), s2.[Description_det]
FROM Sheet2 AS s2
INNER JOIN
(
SELECT s1.[Month],SUM(s1.[Total Value]), s1.[Description_det] FROM Sheet1 AS s1
GROUP BY s1.[Month],s1.[Description_det]
)d ON s2.[Description_det]=d.[Description_det] AND s2.[Month] = d.[Month]
GROUP BY s2.[Month],s2.[Description_det]
;