I have read a previous thread on rolling sums using DSum (http://www.access-programmers.co.uk/forums/showthread.php?t=112221), but I am running into issues with writing the DSum query I want.
Below are a few of the fields I have in table ImportData. (Note that these fields are named as they are when I import the data from a data dump.)
Fiscal Year (CPD) - like 2007, 2008
Month Name (short) - like Jan, Feb
Fiscal Period (CPD) - like 1, 2, 3, where July (or month 1 of the FY) = 1
Non Bad Debt Payments
Bad Debt Payments
Charges
I need to run the following calculation on a rolling three month period:
(Non Bad Debt Payments + Bad Debt Payments)/Charges
I'm not too worried about overlapping Fiscal Years, so for July, it'll be July's NBDP + July's BDP/July's charges. For August, add in August's values. For September, it'll be the sum of July, August, and September's NBDP and BDP/charges for July, August, and September. For October, it'll be the sum of August, September, and October's NBDP and BDP/charges for August, September, and October. (Have I lost you yet?)
I liked where namliam was going in the post dated 08-04-2006, 02:21 AM on the thread above, but I'm getting stuck on just using the Fiscal Year and Fiscal Period instead of a date.
Can anyone help? Could you even get me started with just a rolling sum of Non Bad Debt Payments?
Thanks in advance!
Kate
Below are a few of the fields I have in table ImportData. (Note that these fields are named as they are when I import the data from a data dump.)
Fiscal Year (CPD) - like 2007, 2008
Month Name (short) - like Jan, Feb
Fiscal Period (CPD) - like 1, 2, 3, where July (or month 1 of the FY) = 1
Non Bad Debt Payments
Bad Debt Payments
Charges
I need to run the following calculation on a rolling three month period:
(Non Bad Debt Payments + Bad Debt Payments)/Charges
I'm not too worried about overlapping Fiscal Years, so for July, it'll be July's NBDP + July's BDP/July's charges. For August, add in August's values. For September, it'll be the sum of July, August, and September's NBDP and BDP/charges for July, August, and September. For October, it'll be the sum of August, September, and October's NBDP and BDP/charges for August, September, and October. (Have I lost you yet?)
I liked where namliam was going in the post dated 08-04-2006, 02:21 AM on the thread above, but I'm getting stuck on just using the Fiscal Year and Fiscal Period instead of a date.
Can anyone help? Could you even get me started with just a rolling sum of Non Bad Debt Payments?
Thanks in advance!
Kate