Hello! I'm trying to build a query that keeps a running total up to a certain date for each query entry if it is in the same type.
I have built a simple table that illustrates my case:
ID Date Amount Type1 11/14/2012 100 A
2 11/22/2012 200 A
3 11/23/2012 300 B
4 11/26/2012 200 A
5 11/29/2012 400 B
I have created a query with DSum to keep a running total; however I need the running totals to be different based on type. Currently I have this:
ID Type Year MonthDay RunTot
1 A 2012 11 14
2 A 2012 11 22 100
3 B 2012 11 23 300
4 A 2012 11 26 600
5 B 2012 11 29 800
As you can see, the running total does not consider the type into account.
The current RunTot (Running Total) query function is:
RunTot: DSum("Amount","Orders","DatePart('m', [Orders]![Date] )<=" & [Month] & "And DatePart('yyyy',[Orders]![Date])<=" & [Year] & "And DatePart('d',[Orders]![Date])<" & [Day] & "")
Is there a way to fix this in access query? I've been working on this the whole day but without success.
Thanks![]()