Hi Friends,
I am Looking for Procedure or SQL Script to Calculate Average price for the following Each item number.
Formula:
(Qty Recd - QtySold) * unit price / (Qty recd - qty sold) for Each item
ItemCode Receipt# Qty Recd. Qty Sold Unitprice
A001 RCT001 10 10 10.00
A001 RCT002 15 5 10.00
A001 RCt003 10 00 20.00
B001 RCT002 3 1 10.00
B001 RCT004 1 0 20.00
OUTPUT:
Itemcode Avg.price
A001 15.00
B001 13.33
In this First need to calculate based on the Rceipt number and than group on itemnumber based on the above formula.
Expert help required.
Thanks
AR