Query to find out if the item G/L value is different from WHS value:
SELECT T0.[ItemCode], sum(T0.[InQty]) as "In Qty", Sum(OutQty) as "Out Qty", sum(Transvalue) as "Transaction Value", invntact,
avg( T1.[StockValue]) as "Value in Warehouse", T0.[warehouse] FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode
= T1.ItemCode INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode and t0.warehouse =
t2.whscode GROUP BY
T0.[ItemCode], T0.[InvntAct], T0.[warehouse] having (sum(Transvalue) <> avg(t2.stockvalue)
and sum(transvalue) <> 0)
Please sign in to leave a comment.