(File attached)
I have two separate query: the first shows the sum of value in a period of 36 months from an entered data, the second query show for a period of 500.
I have tried with a IFF but with no success.
These are the two queries:
SELECT ST.L, Sum(ST.C) AS TOT
FROM ST
WHERE (((ST.B)>DateAdd("m",-500,Date())))
GROUP BY ST.L;
SELECT ST.L, Sum(ST.C) AS TOT
FROM ST
WHERE (((ST.B)>DateAdd("m",-1,Date())))
GROUP BY ST.L;
I would like have the this in a single query so I can display immediatelly the result
If tried this:
SELECT Sum(IIf(B > DateAdd("m",-500,Date(), C, 0)) AS Tot, Sum(IIf(B > DateAdd("m",-1,Date(), C, 0)) AS Tot1
From ST
But it is wrong