Use these two queries for running sum. You could change the criteria so that
it gives a running sum of the last 5 entries like this in second query --
WHERE (((Running_Sum_1_1.Rank) Between [Running_Sum_1].[Rank] And
[Running_Sum_1].[Rank]-4))
Running_Sum_1 ---
SELECT Q.[Date close], Sum(Q.x) AS SumOfx, (SELECT COUNT(*) FROM [Change
Requests] Q1
WHERE Q1.[Date close] < Q.[Date close] )+1 AS Rank
FROM [Change Requests] AS Q
GROUP BY Q.[Date close]
ORDER BY Q.[Date close];
SELECT Running_Sum_1.[Date close], Running_Sum_1.Rank,
Sum(Running_Sum_1_1.SumOfx) AS [Running Sum]
FROM Running_Sum_1, Running_Sum_1 AS Running_Sum_1_1
WHERE (((Running_Sum_1_1.Rank)<=[Running_Sum_1].[Rank]))
GROUP BY Running_Sum_1.[Date close], Running_Sum_1.Rank;
--
KARL DEWEY
Build a little - Test a little
Rogier said:
I want to sum records from a table. the second row is the sum of the first
and second row. The thirth row is the sum of the first, second and thirth row
etc. Is someone who can help me?
Best regards
Rogier