I want a running total in a query. I have used a DSUM in the past but needed help with that one also. I have looked at several threads, copied and pasted and still can't get this DSUM to work. This is what the query looks like:
SELECT InfoTable.InvID, InfoTable.Level, InfoTable.Desc, InfoTable.Amt, DSum("[Amt]","[InfoTable]","InvID<='" & [InvID] & "' AND Desc'" & [Desc] & "'") AS RSum
FROM InfoTable
ORDER BY InfoTable.InvID, InfoTable.Level, InfoTable.Desc;
AMT is a number
I want a running total for each InvID/Desc
Each Desc will be unique inside each InvID
This is the data I am looking for:
InvID...........Level...........Desc............Amt..........RSum
ADH1111........1............Balance...........10.0..........10.0
ADH1111........2.............Serial1............-5.0............5.0
ADH1111........2.............Serial2............-2.0............3.0
FRA2222........1.............Balance...........99.1...........99.1
FRA2222........2..............Serial1............-6.0...........93.1
FRA2222........2..............Serial2..........-15.2...........77.9
LUM3535........1..............Balance..........3.0.............3.0
LUM3535........2..............Serial1...........-2.0............1.0
LUM3535........2..............Serial2...........-2.0...........-1.0
Any suggestions would be appreciated.
SELECT InfoTable.InvID, InfoTable.Level, InfoTable.Desc, InfoTable.Amt, DSum("[Amt]","[InfoTable]","InvID<='" & [InvID] & "' AND Desc'" & [Desc] & "'") AS RSum
FROM InfoTable
ORDER BY InfoTable.InvID, InfoTable.Level, InfoTable.Desc;
AMT is a number
I want a running total for each InvID/Desc
Each Desc will be unique inside each InvID
This is the data I am looking for:
InvID...........Level...........Desc............Amt..........RSum
ADH1111........1............Balance...........10.0..........10.0
ADH1111........2.............Serial1............-5.0............5.0
ADH1111........2.............Serial2............-2.0............3.0
FRA2222........1.............Balance...........99.1...........99.1
FRA2222........2..............Serial1............-6.0...........93.1
FRA2222........2..............Serial2..........-15.2...........77.9
LUM3535........1..............Balance..........3.0.............3.0
LUM3535........2..............Serial1...........-2.0............1.0
LUM3535........2..............Serial2...........-2.0...........-1.0
Any suggestions would be appreciated.