I have an example table with fields and records as shown below:
RECORD_ID DATE PRODUCT QUANTITY
1 4/1/05 widget1 50
2 4/2/05 widget1 48
3 4/3/05 widget1 42
4 4/4/05 widget1 28
5 4/5/05 widget1 13
6 4/6/05 widget1 5
.. . . .
.. . . . (and so on)
30 4/30/05 . .
What I need is an output like this:
DATE PRODUCT SOLD (The quantity from the day before - today's)
4/2/05 widget1 2 (50 - 48)
4/3/05 widget1 6 (48 - 42)
4/4/05 widget1 14 (42 - 28)
4/5/05 widget1 15 (28 - 28)
4/6/05 . .
4/7/05 . .
4/8/05 . .
. . .
4/30/05 . . (and so on)
Calculating the quantity SOLD seems like it would be a common database
task and yet this Newbie can only come up with making 30 queries for
each day of the month. I'm wondering if a VBA module could be made to
loop through these records and perform the calculations... but I'm not a
programmer. Any help would be greatly appreciated!
RECORD_ID DATE PRODUCT QUANTITY
1 4/1/05 widget1 50
2 4/2/05 widget1 48
3 4/3/05 widget1 42
4 4/4/05 widget1 28
5 4/5/05 widget1 13
6 4/6/05 widget1 5
.. . . .
.. . . . (and so on)
30 4/30/05 . .
What I need is an output like this:
DATE PRODUCT SOLD (The quantity from the day before - today's)
4/2/05 widget1 2 (50 - 48)
4/3/05 widget1 6 (48 - 42)
4/4/05 widget1 14 (42 - 28)
4/5/05 widget1 15 (28 - 28)
4/6/05 . .
4/7/05 . .
4/8/05 . .
. . .
4/30/05 . . (and so on)
Calculating the quantity SOLD seems like it would be a common database
task and yet this Newbie can only come up with making 30 queries for
each day of the month. I'm wondering if a VBA module could be made to
loop through these records and perform the calculations... but I'm not a
programmer. Any help would be greatly appreciated!
Comment