Thanks for your reponse
SELECT T1.[ItemCode], T1.[U_EA_Packgroup], T1.[Dscription], T2.[CardName], T2.[DocNum], T2.[DocDate], T2.[NumAtCard], T2.[TaxDate], T1.[U_EA_Case], sum(T0.[U_EA_Case]) as 'Delivered'
FROM DLN1 T0
INNER JOIN RDR1 T1 ON T0.BaseEntry = T1.DocEntry AND T0.BaseLine = T1.LineNum
INNER JOIN ORDR T2 ON T1.DocEntry = T2.DocEntry
Group by T1.[ItemCode], T1.[U_EA_Packgroup], T1.[Dscription], T2.[CardName], T2.[DocNum], T2.[DocDate], T2.[NumAtCard], T2.[TaxDate], T1.[U_EA_Case]
Used, this code.
1) Now I not getting sales orders with none being delivered. The output of the query is list of items with atleast 1no(case) being delivered.
2) I need all Open Sales orders, I tried adding T2.[LineStatus] = 'O' before Group By but its not executing
3) Also, I need to bring abt the balance qty (Ordered cases - Delivered cases)
How to bring about?