I am trying to build a query to obtain the Delivery dates for specific line items based on the Delivery documents and compare that to the Delivery date on the Sales Order form.
SELECT T0.[DocNum], T0.[TaxDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[ShipDate], T2.[DocNum], T2.[TaxDate], T3.[BaseRef], T3.[ShipDate]
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] left outer JOIN DLN1 T3 on T3.BaseEntry = T0.DocEntry AND T1.LineNum=T3.BaseLine, ODLN T2 INNER JOIN DLN1 T3 ON T2.[DocEntry] = T3.[DocEntry]
I kind of understand that I am using an alias twice but I have no idea how to fix this. Any help is greatly appreciated.
I also know that I need to put in a where clause for the "closed" lines on the Sales Order.
Thank you Experts.