Skip to Content
0
Former Member
May 11, 2010 at 06:49 PM

Formatted Search Query for BatchNo

29 Views

Dear All,

I am using the following query as formated search for Identifying the batches availble during the creation of Delivary document

in a user defined column at row level. When i click on this field it's showing the Batches for the Item with Zero Qty also.

I need to display only the batches where the QTY >0. This query displaying even the Zero Qty Batches also. Please help me to modify the below query for getting the above. Below is the query .

SELECT distinct T4.[BatchNum] FROM [dbo].[OIBT] T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN DLN1 T2 ON T1.ItemCode = T2.ItemCode INNER JOIN ODLN T3 ON T2.DocEntry = T3.DocEntry INNER JOIN IBT1 T4 ON T0.BatchNum = T4.BatchNum AND T3.DocNum = T4.BaseNum INNER JOIN OWHS T5 ON T0.WhsCode = T5.WhsCode WHERE T0.[ItemCode] = $[$38.1] AND T4.[WhsCode] = $[$38.24] AND T0.[Quantity]>=$[$38.11]

Regards

Srini