cancel
Showing results for 
Search instead for 
Did you mean: 

Query for delivery not that includes reference to applicable sales order number

Former Member

I would like to create a query of information from the delivery not that includes a reference to the applicable sales order. I know that there is a reference to the sales order in the remarks but I would like to have the field separate.

Accepted Solutions (0)

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

Hi Michelle,

That information can be found in the DLN1 table (delivery note rows).

Here is a basic query to give you an idea:

SELECT T1.[DocNum] /* Document number of the delivery note */
     , T1.[CardCode]
     , T1.[CardName]
     , T0.[ItemCode]
     , T0.[Dscription]
     , T0.[Quantity]
     , T0.[BaseRef] /* Document number of the sales order */
     , T0.[BaseEntry] /* DocEntry of the sales order */
     , T0.[BaseLine] /* line number in the sales order */
FROM DLN1 T0
     INNER JOIN ODLN T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.[DocNum] =[%0]

Regards,

Johan