Hi,
SELECT T0.[ItemCode] as 'Stock Code', T0.[Dscription] as 'Description',sum(T0.[InQty])-sum(T0.[OutQty]) as 'Qty In Stock', avg(T0.[CalcPrice]) as 'Avg Item Cost', sum(T0.[TransValue]) as 'Total Value of the item in stock' FROM OINM T0 WHERE T0.[DocDate] between [%0] and [%1] and T0.[ItemCode] not in (select itemcode from wor1 where itemcode=t0.itemcode)
and (SELECT D.[ItmsGrpNam] FROM OITM C INNER JOIN OITB D ON C.ItmsGrpCod = D.ItmsGrpCod where T0.[ItemCode] =C.[ItemCode])='Component Item'
GROUP BY T0.[ItemCode], T0.[Dscription]
Above query will show negative stock for item because of date range.
ragrds,
Raviraj