Skip to Content
1

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

Nov 02, 2017 at 05:10 PM

20

avatar image
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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Johan Hakkesteegt Nov 03, 2017 at 08:32 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded