Cr 8.5
SQL Server 2000
Hi All,
Can someone give me a pointer on how to approach a problem on a report to show the consumption of consigned stock?
The logic is a bit complicated but here goes.
The expample has 3 items, A,B,C
The customer was given a qty(opening balance) of 100 on 31/08/2004 for each Item.
I want to track month by month how much of the OB was consumed. The customer can over consume the stock (they can source it from another supplier)
Table1
Item, Date, UsedQty, OpenningBalance(31/08/2004)
A, 1/9/2004, 10, 100
A, 20/9/04, 200, 100
A, 1/10/04, 10, 100
B, 1/9/04, 80, 100
B, 1/10/04, 60, 100
C, 1/10/04, 120, 100
For Item A, in Sept, I only need to report 100, as total usage, 210, was greater than the qty supplied.
In Oct, report qty = 0 as fully used in Sept.
For Item B, in Sept, I only need to report 80.
In Oct, report qty = 20 (the remaining balance of the 100)
For Item C, in Sept, report qty = 0.
In Oct, report qty = 100 as total usage, 120, was greater than the qty supplied, 100.
I also have flexability to change the table structure
Thanks for any pointers.
Fred
Cheers
Fred
SQL Server 2000
Hi All,
Can someone give me a pointer on how to approach a problem on a report to show the consumption of consigned stock?
The logic is a bit complicated but here goes.
The expample has 3 items, A,B,C
The customer was given a qty(opening balance) of 100 on 31/08/2004 for each Item.
I want to track month by month how much of the OB was consumed. The customer can over consume the stock (they can source it from another supplier)
Table1
Item, Date, UsedQty, OpenningBalance(31/08/2004)
A, 1/9/2004, 10, 100
A, 20/9/04, 200, 100
A, 1/10/04, 10, 100
B, 1/9/04, 80, 100
B, 1/10/04, 60, 100
C, 1/10/04, 120, 100
For Item A, in Sept, I only need to report 100, as total usage, 210, was greater than the qty supplied.
In Oct, report qty = 0 as fully used in Sept.
For Item B, in Sept, I only need to report 80.
In Oct, report qty = 20 (the remaining balance of the 100)
For Item C, in Sept, report qty = 0.
In Oct, report qty = 100 as total usage, 120, was greater than the qty supplied, 100.
I also have flexability to change the table structure
Thanks for any pointers.
Fred
Cheers
Fred