G
Guest
I have made a query to compute how many Items Of Stock I currently have,
using the SQL below:
SELECT tblProducts.ProductCode,
Sum(tblProducts.Quantity)-NZ(Sum(tblTransactionDetails.Quantity),0) AS
QuantityInStock
FROM tblProducts LEFT JOIN tblTransactionDetails ON tblProducts.ProductCode
= tblTransactionDetails.ProductCode
GROUP BY tblProducts.ProductCode;
The query has only worked once reducing quantities using the value from
'tblProducts'. But when I try and work it now the query produces results
larger than the value in 'tblProducts' e.g. Original Quantity = 18, when
Transactions have gone through, the query has computed the Items In Stock =
238.
Can anyone help me figure out what the problem is?
using the SQL below:
SELECT tblProducts.ProductCode,
Sum(tblProducts.Quantity)-NZ(Sum(tblTransactionDetails.Quantity),0) AS
QuantityInStock
FROM tblProducts LEFT JOIN tblTransactionDetails ON tblProducts.ProductCode
= tblTransactionDetails.ProductCode
GROUP BY tblProducts.ProductCode;
The query has only worked once reducing quantities using the value from
'tblProducts'. But when I try and work it now the query produces results
larger than the value in 'tblProducts' e.g. Original Quantity = 18, when
Transactions have gone through, the query has computed the Items In Stock =
238.
Can anyone help me figure out what the problem is?