0
我正在撰寫包含銷售訂單信息+交貨單的報表。我想要做的是從採購訂單(例如PO#& Price)表中添加信息(我相信這是OPOR)。我如何將此錶鏈接到我已有的一個或多個表格?請參閱下面的查詢:將採購訂單與銷售訂單鏈接的查詢
SELECT o0.NumAtCard AS OrderNo
,i0.DocNum
,i0.TrackNo AS TrackingNo
,i0.CardName
, o0.DocNum AS DelivDoc
FROM ODLN d0
INNER JOIN DLN1 d1 ON d0.DocEntry = d1.DocEntry
LEFT OUTER JOIN INV1 i1 ON d1.TrgetEntry = i1.DocEntry
LEFT OUTER JOIN OINV i0 ON i1.DocEntry = i0.DocEntry
INNER JOIN ORDR o0 ON d1.BaseEntry = o0.DocEntry
INNER JOIN OITM itm ON i1.ItemCode = itm.ItemCode
WHERE o0.CANCELED = 'N' AND
i0.TrackNo IS NOT NULL
GROUP BY o0.NumAtCard
|,i0.DocNum
|,i0.TrackNo
,i0.CardName
,o0.DocNum
ORDER BY o0.NumAtCard
你想在表格中輸入什麼樣的信息?它如何加入? –
我想在報告中添加採購訂單號和價格 – vnguyen
在ORDR表中是否存在或除此之外?另外,如果您有4個ORDR條目和3個採購訂單,您預計會有多少行? 12? –