cancel
Showing results for 
Search instead for 
Did you mean: 

help with query OINV = ODLN

former_member315373
Discoverer
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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

Answers (1)

Answers (1)

S0023996343
Discoverer
0 Kudos

Dear all,

how can I link ORIN and OINV in case of relation based only on related document link?

Thanks