I have been trying all morning to calculate a running sum in a query (the query is to obtain as invoice total). My tblInvoice has several rows - each row has (amoung other things) InvoiceID(PK), InvoiceNo, RegionalAmountDue - this is a total cost for that line in the invoice. Each row in tblInvoice represents a row on an invoice. i.e. if there are 3 rows on an invoice, there are 3 rows in tblInvoice. I am trying to sum the RegionalAmountDue (price) for each row - by InvoiceNo...
here is my SQL:
In the query, the first three colummns are as expected - the last gives me "#Error" - in tblInvoice, there are no Nulls. Any ideas what I am doing wrong?
Thanks, PDUNCAN
here is my SQL:
Code:
select tblInvoice.InvoiceID, tblInvoice.InvoiceNo, tblInvoice.RegionalAmountDue, Format (DSUm("RegionalAmountDue", "tblInvoice", "InvoiceNo = " & [InvoiceNo] & " And InvoiceID <=" & [InvoiceID]), "Currency") as RunningSum
from tblInvoice;
In the query, the first three colummns are as expected - the last gives me "#Error" - in tblInvoice, there are no Nulls. Any ideas what I am doing wrong?
Thanks, PDUNCAN