Skip to Content
Former Member
Jan 24, 2012 at 09:11 AM

Query for batchwise remaining stock



i create the following query that show remaining quantity in that batch the quer are as,

SELECT T0.[ItemCode], T0.[Quantity], T0.[WhsCode], T3.[ItmsGrpNam], T1.[DistNumber] FROM OBTQ T0 INNER JOIN OBTN T1 ON T0.AbsEntry = T1.AbsEntry INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T0.[WhsCode] ='WH01' ORDER BY T3.[ItmsGrpNam], T0.[ItemCode]

but i want to more field in that query that it should show purchase price for that batch & remaining quantity

the qurey should display

Item code , Remaining Quantity, Warehouse,ItemGrpName,batch Num, Purchase Price