Effective February 22, 2024, Google Groups will no longer support new Usenet content. Posting and subscribing will be disallowed, and new content from Usenet peers will not appear. Viewing and searching of historical data will still be supported as it is done today.
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()
Reply all
Reply to author
Forward
0 new messages