SELECT InvMovements.StockCode AS StockCode, SUM(InvMovements.TrnQty) AS QTY
FROM InvMovements INNER JOIN
InvMaster ON InvMovements.StockCode = InvMaster.StockCode
WHERE (InvMovements.EntryDate BETWEEN CONVERT(DATETIME, '2010-05-31 00:00:00', 102) AND CONVERT(DATETIME, '2010-06-27 00:00:00', 102)) AND
(InvMovements.TrnType = 'R') AND (InvMaster.ProductClass IN ('PDM', 'PRM', 'TM', 'PM'))
GROUP BY InvMovements.StockCode
ORDER BY InvMovements.StockCode
|