L
lemes_m
Hi All!
I have very big problem and I can't continue my Work on my project
until i solve it.
Here is the situation:
TblCalculations
FldCalcId FldArticle FldQuantity FldPrice FldAvgPrice
1 1 10.000 0,20 0,20
1 1 15.000 0,10 X
Value X will be (10.000*0,20+15.000*0,10)/(10.000+15.000)=0,14
I need stored procedure, VBA code or anything else that will update
TblCalculations, FldAvgPrice with this formula, but it has to do
row by row because previous row value has to be included in
calculation.
Also, this calculation should be done only for articles which has some
FldCalcId value. I was thinking about FOR EACH Statement but I don't
know how to do it.
PLEASE HELP!
Regards,
Mirnes Lemes
I have very big problem and I can't continue my Work on my project
until i solve it.
Here is the situation:
TblCalculations
FldCalcId FldArticle FldQuantity FldPrice FldAvgPrice
1 1 10.000 0,20 0,20
1 1 15.000 0,10 X
Value X will be (10.000*0,20+15.000*0,10)/(10.000+15.000)=0,14
I need stored procedure, VBA code or anything else that will update
TblCalculations, FldAvgPrice with this formula, but it has to do
row by row because previous row value has to be included in
calculation.
Also, this calculation should be done only for articles which has some
FldCalcId value. I was thinking about FOR EACH Statement but I don't
know how to do it.
PLEASE HELP!
Regards,
Mirnes Lemes