running sum
1 TopicDsum
Hello experts, I need to make a running sum total on tblDrawsDetails.Amount but noting the where clause. Please see attached accdb and xls file. I have the following but it just returns the grand total of Amount but I need it to sum where the ID< ID RunningSum: (DSum("Amount","tblDrawsDetails","FacIDfk=" & [FacIDfk] And [ID]<=[ID])) SELECT tblDrawsDetails.ID, tblDrawsDetails.FacIDfk, tblDrawsDetails.Amount, tblDrawsDetails.DateRecd, (DSum("Amount","tblDrawsDetails","FacIDfk=" & [FacIDfk] And [ID]<=[ID])) AS RunningSum, Year([DateRecd])*12+DatePart('m',[DateRecd])-1 AS MonthYrSort, First(Format([Daterecd],"yyyy"", ""mmmm")) AS FundingDateGrp FROM tblDrawsDetails GROUP BY tblDrawsDetails.ID, tblDrawsDetails.FacIDfk, tblDrawsDetails.Amount, tblDrawsDetails.DateRecd, Year([DateRecd])*12+DatePart('m',[DateRecd])-1 ORDER BY Year([DateRecd])*12+DatePart('m',[DateRecd])-1;Solved171Views0likes8Comments