Hi all,
I really need your help with a query that calculates the cumulative total spent on expenses as each month passes. Here is the query I have written:
The line that is for the cumulative total/running total is
I really appreciate any help and my employer is really turning the screw to get this feature to work. I just get error in the field for this query section.
I don't think I'm too far off but any help would be greatly appreciated as I can copy it into 6 more similar queries.
I really need your help with a query that calculates the cumulative total spent on expenses as each month passes. Here is the query I have written:
Code:
SELECT DISTINCTROW Format(DatePart("m",[InvoiceDate]),"00") & " - " & Format(DatePart("yyyy",[InvoiceDate]),"0000") AS Expr1, Expenses.[Expense Type], Sum(Expenses.Amount) AS [Sum Of Amount], (DSum("Amount","Expenses","[Expenses].[Expense Type] <=" & [Expenses].[Expense Type])) AS [Running Total]
FROM Expenses
GROUP BY Format(DatePart("m",[InvoiceDate]),"00") & " - " & Format(DatePart("yyyy",[InvoiceDate]),"0000"), Expenses.[Expense Type]
HAVING (((Format(DatePart("m",[InvoiceDate]),"00") & " - " & Format(DatePart("yyyy",[InvoiceDate]),"0000")) Not Like "?-?"))
ORDER BY Format(DatePart("m",[InvoiceDate]),"00") & " - " & Format(DatePart("yyyy",[InvoiceDate]),"0000"), Expenses.[Expense Type];
The line that is for the cumulative total/running total is
Code:
(DSum("Amount","Expenses","[Expenses].[Expense Type] <=" & [Expenses].[Expense Type])) AS [Running Total]
I really appreciate any help and my employer is really turning the screw to get this feature to work. I just get error in the field for this query section.
I don't think I'm too far off but any help would be greatly appreciated as I can copy it into 6 more similar queries.