Cumulative values

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

Has anyone a idee how to create a field in a query calculating the
cumulative values. I intent to use this for diagram with these values in
relation to the dates.
In excel is is a simpel calculation, but i could not create it yet in
Access.

Jan
 
I assume that you wish to add an extra row at the end of your query to
display the sum total?

If so the way to do it is to create two queries, one with the individual
values and another with the same number of columns, but just one row with
the sum.

Create a third query which joins these two using the UNION keyword. Examples
in Help.
 
Do you mean:

D F Cum
1/1/2004 3 3
2/1/2004 5 8
3/1/2004 2 10

or somesuch?

If so, try: (untested)

SELECT
D,
F,
(SELECT SUM(T2.F)
FROM T AS T2
WHERE T2.D <= T1.D)) AS [Cum]
FROM T AS T1
ORDER BY D

HTH,
TC
 
Thanks for your reply but this is not what I'm looking for. I'm looking for
the result as TC example:
D F Cum
1/1/2004 3 3
2/1/2004 5 8
3/1/2004 2 10
Only the proposed program did not worked (syntacts error) Can you help me?
Jan
 
Thanks for your reply but this is not what I'm looking for. I'm looking for
the result as TC example:
D F Cum
1/1/2004 3 3
2/1/2004 5 8
3/1/2004 2 10
Only the proposed program did not worked (syntacts error) Can you help me?
Jan
 
Back
Top