modglin
Programmer
- Apr 10, 2001
- 105
I have a report that has several tables joined
The first table supplies a location, date, product
the second table provides # units @ end of day - (only has
this info if any were received or sold)
the third table provides # unit sold
the fourth provides # new units put into stock
The report has a group for each store then each product.
I am trying to show a monthly total for November for each product:
Product, BeginningUnits, RcdUnits, SoldUnits, EndingUnits
A 3 5 6 2
B 5 0 4 1
C 2 0 2 0
The Monthly Sold and Recd are no problem - my problem is getting the BeginningUnits if they did not sell or purchase one of the products on the last day of the previous month. I originally thought I could use a formula something like
if isnull{ONHAND} then previousrecord, however, if the product has not been sold or received since the 15th the last date that has information is the 15th and the detail isnull for the 16, 17, 18 and etc.
I am certain that I need to do a whileprintingrecords and use a loop, but I am not sure how to write this.
the detail information would look something like this
Date Prod Sales Purch EndofDay
10/31 A 0 2 10
11/1 A 1 9
11/2 A
11/3 A 5 14
11/4 A 7 7
11/5 A
11/6 A
etc . . .
Total A 8 7 (This is my problem)
The first table supplies a location, date, product
the second table provides # units @ end of day - (only has
this info if any were received or sold)
the third table provides # unit sold
the fourth provides # new units put into stock
The report has a group for each store then each product.
I am trying to show a monthly total for November for each product:
Product, BeginningUnits, RcdUnits, SoldUnits, EndingUnits
A 3 5 6 2
B 5 0 4 1
C 2 0 2 0
The Monthly Sold and Recd are no problem - my problem is getting the BeginningUnits if they did not sell or purchase one of the products on the last day of the previous month. I originally thought I could use a formula something like
if isnull{ONHAND} then previousrecord, however, if the product has not been sold or received since the 15th the last date that has information is the 15th and the detail isnull for the 16, 17, 18 and etc.
I am certain that I need to do a whileprintingrecords and use a loop, but I am not sure how to write this.
the detail information would look something like this
Date Prod Sales Purch EndofDay
10/31 A 0 2 10
11/1 A 1 9
11/2 A
11/3 A 5 14
11/4 A 7 7
11/5 A
11/6 A
etc . . .
Total A 8 7 (This is my problem)