Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8451

Re: Query To Check Stock That Hasn't Been Used In A Date Range

$
0
0

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


Viewing all articles
Browse latest Browse all 8451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>