Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 03, 2017 at 08:32 AM

    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

    Add comment
    10|10000 characters needed characters exceeded