I have a query with the following fields:
Month, Year, YearMonth, AmtW, AmtD, TotD, TotW
The YearMonth field just concatenates year, and then month. The TotD and TotW fields are DSUMS, but I can't get them to work properly. I want the DSUMS to sum all values in AmtW or AmtD where YearMonth is less than or equal to what the current row is. For example:
Month..........Year............YearMonth.........AmtW.........AmtD..........TotD
............TotW
April...........2005.............200504.............($5)...........$20..........
...$20.............($5)
June..........2005.............200506.............$0..............$100..........
$120............($5)
Sept...........2006............200609.............($45)...........$0............
.$120............($50)
I am trying to use the YearMonth for the condition in DSUM, but I can't get it to work right. Any ideas? Thanks.