Accumulating sums

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Accumulating sums

I have a table with the following with 2 main columns: Year
(2001,2002,2003…) and Value (200,300,400…)

I want to make a query that will sum the value of the actual year plues the
past years like this:

Year Value AccumulatedValue
2001 200 200
2002 300 500
2003 400 900
2004 500 1400

Is there any body to know how to make this query?

Thanks a lot
 
Accumulating sums

I have a table with the following with 2 main columns: Year
(2001,2002,2003…) and Value (200,300,400…)

I want to make a query that will sum the value of the actual year plues the
past years like this:

Year Value AccumulatedValue
2001 200 200
2002 300 500
2003 400 900
2004 500 1400

Is there any body to know how to make this query?

Thanks a lot

It's very easy on a Report: simply bind two textboxes (labeled Value
and AccumulatedValue) to the Value field, and set the Running Sum
property of AccumulatedValue to "Over All".

In a Query, you'll need to use DSum:

SELECT [Year], [Value], DSum("[Value]", "tablename", "[Year] <= " &
[Year]) AS AccumulatedValue;

John W. Vinson[MVP]
 
Hey! John, thanks a lot!!!! You do not know how much you had help me.
Thanks, thanks, thanks...

John Vinson said:
Accumulating sums

I have a table with the following with 2 main columns: Year
(2001,2002,2003…) and Value (200,300,400…)

I want to make a query that will sum the value of the actual year plues the
past years like this:

Year Value AccumulatedValue
2001 200 200
2002 300 500
2003 400 900
2004 500 1400

Is there any body to know how to make this query?

Thanks a lot

It's very easy on a Report: simply bind two textboxes (labeled Value
and AccumulatedValue) to the Value field, and set the Running Sum
property of AccumulatedValue to "Over All".

In a Query, you'll need to use DSum:

SELECT [Year], [Value], DSum("[Value]", "tablename", "[Year] <= " &
[Year]) AS AccumulatedValue;

John W. Vinson[MVP]
 

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

Similar Threads

Excel Complex Summing 3
Dsum Expression 1
Access Running Balance in Access 1
crosstab problem 2
Year-to-Date Query 1
Sum the row values 2
SQL JOIN simplifying 5
UNION Query problem 4

Back
Top