Experts,
I have a query that is to show the client Sales Order and Purchase order lines that are linked by line UDF.
The standard BaseType/Ref/Key fields will not work as they will contain the Sales Quote info on the Sales Order.
SELECT
T2."DocNum" AS "SO#", T2."CardName", T2."DocDate", T0."ItemCode", T0."Dscription", T0."Quantity", T0."U_MD_01", T0."U_MD_02",
T3."DocNum" AS "PO#", T3."CardName", T3."DocDate", T1."ItemCode", T1."Dscription", T1."Quantity", T1."U_MD_01"
FROM RDR1 T0
INNER JOIN POR1 T1 ON T0.U_MD_01 = T1.U_MD_01
INNER JOIN ORDR T2 ON T0."DocEntry" = T2."DocEntry"
INNER JOIN OPOR T3 ON T1."DocEntry" = T3."DocEntry"
WHERE T0."U_NBS_MD_01" =[%0]
My issue with this query is that the lines are duplicating.
Any advise will be appreciated.
Marli