on 04-07-2017 12:52 PM
Hello Experts,
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.
Keith H
Hi Keith
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 INNER JOIN ODLN T2 ON T2.[DocEntry] = T3.[DocEntry] where T1.Linestatus='C'
Regards:
Balaji.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.