Hi Experts,
I have a query currently in use to show me the status for open sales order whcih contain a particular item (embroidery)
It works okay but I would like to know if there is a way in SQL to show ALL the items in every sales order which contains the 'EMB-INTERNAL' item code? In the current dataset I only see the lines with EMB-INTERNAL but I need to see all the rows.
thanks
Geoff
SELECT T1.[DocNum], T1.[CardCode]'Customer No.', t4.firstname+' '+t4.lastname as 'Owner', T0.[FrozenFor]'On Hold', T1.[CardName]'Customer Name', T3.[GroupName], T1.[DocDate], T1.[DocDueDate]'Due Date', T1.[U_EmbScheDate]'SCHEDULED', T1.[U_ReadyTD]'STATUS', T2.[ItemCode], T2.[Dscription], T2.[Quantity], T2.[U_TotPick], T2.[U_Picker], T2.[U_PickDate],
FROM OCRD T0 INNER JOIN ORDR T1 ON T0.CardCode = T1.CardCode INNER JOIN RDR1 T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OCRG T3 ON T0.GroupCode = T3.GroupCode INNER JOIN OHEM T4 ON T1.OwnerCode = T4.empID
WHERE T1.[DocStatus] ='O' and T2.[ItemCode]='EMB-INTERNAL' and T1.[Confirmed] ='Y' and T1.[U_EmbHeldStat] NOT IN ('1','6','12')
ORDER BY T1.[DocDueDate] ASC, T1.[DocNum] ASC