Cumulative values

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
 
K

Kailash Kalyani

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.
 
T

TC

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
 
J

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
 
J

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top