Dear experts,
I have an SQL report which extracts the finished goods' batch data. So far the report had been good for our purpose. But recently we have started to allocate the batches on the sales orders, and we do not wish to see those batches in this report. Could someone please advise if we can do that?
Thanks in advance.
Best Regards
K
Below is the report:
SELECT T0.ItemCode AS 'Item No.', IT.ItemName AS 'Item Description', T5.ItmsGrpNam as 'Application', T0.BatchNum AS 'Batch Number', T0.CardCode AS 'BP Code', T0.CardName AS 'BP Name', T0.IntrSerial as 'Mfg/Fact', T0.InDate AS 'Admission Date', T0.Located AS 'Location', T0.WhsCode AS 'Warehouse Code', T0.Quantity as 'WH Qty(M)', T0.Quantity * IT.U_ITWTSTU as 'WH Qty(KG)', T0.Quantity * T4.AvgPrice as 'Total_Stock_Val' FROM OIBT T0 INNER JOIN OITM IT ON T0.ItemCode = IT.ItemCode INNER JOIN OITB T5 ON IT.ItmsGrpCod = T5.ItmsGrpCod INNER JOIN OITW T4 ON T4.ItemCode = IT.ItemCode and T4.WhsCode = T0.WhsCode WHERE T0.Quantity > 0 AND (IT.QryGroup1 = 'Y' OR IT.QryGroup2 = 'Y' OR IT.QryGroup3 = 'Y' OR IT.QryGroup4 = 'Y') AND T5.ItmsGrpNam LIKE 'FG%'