Skip to Content
0
May 05, 2020 at 02:39 PM

Production Order Query Help.

73 Views

We are trying to get the Posting date from OIGN to show as the 'Finishing Date for the Production order.

Cannot get any joins to work.

SELECT DISTINCT T1.[U_ConfirmDate] as 'Confirm Date', T0.[StartDate],T0.[RlsDate] as 'Release Date',T0.[DueDate] as 'PWO Due',T1.[ReqDate] as 'No Sooner',T2.[Project], T2.[LineTotal], T0.[Status] as 'WO Status',T2.[U_ATR] as 'Can Resell',T1.[CardName] as 'Customer Name',T1.[DocNum] as 'SO#',T1.[DocDueDate] as 'SO Due Date',T0.[DocNum] as 'PWO#',T4.[SlpName],T2.[Quantity] as 'Order Qty', T0.[CmpltQty] as 'Cmpltd Qty', T2.[ItemCode], T2.[Dscription] as 'Item Description', T0.[U_POV] as 'OPs Verified' FROM OWOR T0 INNER JOIN ORDR T1 ON T0.[OriginNum]=T1.[DocNum] INNER JOIN RDR1 T2 ON T1.[DocEntry] = T2.[DocEntry] INNER JOIN WOR1 T3 ON T0.[DocEntry] = T3.[DocEntry] INNER JOIN OSLP T4 ON T1.[SlpCode] = T4.[SlpCode] WHERE T2.[PoTrgNum]=T0.[DocNum] AND T1.[U_DCTY] ='C' AND T1.[DocStatus] ='O' AND (T0.[Status] ='L' or T0.[Status]='R' or T0.[Status]='P') AND T1.[Confirmed] ='Y' AND (T2.[DelivrdQty]='0' or T2.[DelivrdQty] is Null)