Skip to Content

help with query OINV = ODLN

I create query to display invoices based on delivery note

the result are incorrect

can someone tell me what is the problem?

select T0.DocNum,T0.DocDate,T0.CardCode ,T0.CardName ,T0.DocTotal ,T3.DocNum

from oinv T0 inner join INV1 T1 on T0.DocEntry=T1.DocEntry

inner join DLN1 T2 on T1.BaseRef=T2.DocEntry

inner join ODLN T3 on T3.DocEntry=T2.DocEntry

thank you

Elad

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 29, 2015 at 11:27 AM

    Hi

    the problem is that your connection between dln1 and inv1 is not the correct field

    you should use this query :

    T0.DocNum,T0.DocDate,T0.CardCode ,T0.CardName ,T0.DocTotal ,T3.DocNum


    oinv T0 inner join INV1 T1 on T0.DocEntry=T1.DocEntry


    join DLN1 T2 on T1.BaseEntry=T2.DocEntry


    join ODLN T3 on T3.DocEntry=T2.DocEntry

    shachar

    Add comment
    10|10000 characters needed characters exceeded