I searched SO and Google for awhile but couldn't seem to find any that related to this error occurring in the set part of the code and if it did occur in that part, the solution didn't help me.
I am trying to use a user inputted weight and subtract it by the total weight. This equals the Shrink
SET @Shrink = @InputWeight - [ICPL].[OriginalQuantity_Stk];
I also tried it this way and got the same error.
SET @Shrink = @InputWeight - Sum([ICPL].[OriginalQuantity_Stk]);
The table is called IC_ProductLots and the alias is ICPL
The error I get is:
The multi-part identifier "ICPL.OriginalQuantity_Stk" could not be bound.
Here are my joins if that helps at all:
FROM (((( IC_Products [PC]
INNER JOIN DC_Transactions [DCT]
ON [PC].ProductKey = [DCT].ProductKey)
INNER JOIN AR_Customers
ON [DCT].CustomerKey = AR_Customers.CustomerKey)
INNER JOIN IC_ProductLots [ICPL]
ON [DCT].LotKey = [ICPL].LotKey)
LEFT OUTER JOIN IC_ProductCosts [ICP]
ON ICP.ProductKey=PC.ProductKey and ICP.ProductCostCode=5)
Let me know if seeing any more code would help.
Aucun commentaire:
Enregistrer un commentaire