Skip to Content
0

ERROR - the correlation name is specified multiple times in a from clause - How do I fix

Apr 07, 2017 at 11:52 AM

66

avatar image

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

SQL
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Balaji Selvaraj Apr 07, 2017 at 11:58 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you - I believe this is exactly what they needed.

0