Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 07, 2017 at 11:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded