Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cumulative totals

6 views
Skip to first unread message

mrma...@gmail.com

unread,
Jan 8, 2020, 1:36:56 PM1/8/20
to
I have a table called "DailyNewAccounts"with the following entries:

CountOfid yyyymmdd
8 2019/11/01
8 2019/11/02
11 2019/11/03
7 2019/11/04

where CountOfid and yyyymmdd are the field names

I am struggling to create a query that will result in:

CountOfid yyyymmdd cumulative
8 2019/11/01 8
8 2019/11/02 16
11 2019/11/03 27
7 2019/11/04 34


The end result is that I need to create a chart for both daily new accounts and cumulative.


Any help much appreciated,

Cheers

James

Ron Weiner

unread,
Jan 8, 2020, 2:05:21 PM1/8/20
to
mrma...@gmail.com wrote :
Try:

SELECT DailyNewAccounts.yyyymmdd, DailyNewAccounts.CountOfid,
(Select Sum(CountOfid) From DailyNewAccounts as RT
Where RT.yyyymmdd <=DailyNewAccounts.yyyymmdd) AS cumulative
FROM DailyNewAccounts
ORDER BY DailyNewAccounts.yyyymmdd;

Rdub

James Poole

unread,
Jan 12, 2020, 1:42:36 PM1/12/20
to
Many thanks. I was lost in the world of dsum()
0 new messages