Skip to Content
0
Former Member
Apr 20, 2010 at 06:50 AM

Help with query

22 Views

Hi All,

I have this query which is showing me the correct result however, the need is to display the values only in case where "Balance Quantity' is not null. Can this be achieved? If yes, please guide.

SELECT T0.DocNum, T0.DocDate, T0.U_Prod_Order_No, T1.ItemCode, T1.Dscription,

T1.Quantity as 'Issued from Store' , T1.WhsCode as 'to Whse' ,T2.DocNum as 'Production no.',

T2.PlannedQty, T3.ItemCode as 'Components', T3.PlannedQty as 'Components Planned Qty',

T3.IssuedQty as 'Components Issued Qty' ,

T3.wareHouse,(T3.PlannedQty - T1.Quantity) as 'Balance Quantity'

FROM OWTR T0 , WTR1 T1 , OWOR T2 , WOR1 T3

where

T0.DocEntry = T1.DocEntry and T2.DocEntry = T3.DocEntry and

T2.DocNum = T0.U_Prod_Order_No and T0.U_Prod_Order_No = '[%0]' and

T1.ItemCode=T3.ItemCode and T1.WhsCode = T3.wareHouse