How do i gennerate a field containing the cummulative in a query?

G

Guest

I want to create a query that calculates a cummulatinve sum of values that
are ordered descending.

I.e
NAME VALUE CSUM
aaa 100 100
bbb 90 190
ccc 50 240
ddd 20 260

Any ideas?

Any help would be much appreciated
 
M

Michel Walsh

SELECT a.name, LAST(a.value), SUM(b.value)
FROM myTable As a INNER JOIN myTable As b
ON a.name >= b.name
GROUP BY a.name



Hoping it may help,
Vanderghast, Access 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

Top