cancel
Showing results for 
Search instead for 
Did you mean: 

Batch Query Delivery

former_member208987
Participant
0 Kudos

Hi,

I need to insert batchdetails of the delivery.

I created an query but get to many lines.

Does somebody see the problem in my query?

If the query give the right result i use it in my crystal report as a subreport based on docentry.

SELECT T0.DocNum, T1.ItemCode , T1.Dscription , T1.Quantity, T2.BatchNum  from ODLN T0

LEFT OUTER JOIN DLN1 T1 on T0.DocEntry = T1.DocEntry

LEFT JOIN IBT1 T2 on T2.BaseType = T0.ObjType AND T2.BaseNum = T0.DocNum

Where T0.DocEntry = 9

Greetings

Mark

Accepted Solutions (1)

Accepted Solutions (1)

KennedyT21
Active Contributor
0 Kudos

Hi Mark...

Try with this

SELECT  distinct T0.DocNum, T1.ItemCode , T1.Dscription , T1.Quantity, T2.BatchNum  from ODLN T0

inner JOIN DLN1 T1 on T0.DocEntry = T1.DocEntry

inner JOIN IBT1 T2 on T2.BaseType = T0.ObjType AND T2.BaseNum = T0.DocNum

Regards

Kennedy

former_member208987
Participant
0 Kudos

Hi,

this will work.

SELECT  distinct T0.DocNum, T1.ItemCode , T1.Dscription , T1.Quantity, T2.BatchNum  from ODLN T0

inner JOIN DLN1 T1 on T0.DocEntry = T1.DocEntry

inner JOIN IBT1 T2 on T2.BaseType = T0.ObjType AND T2.BaseNum = T0.DocNum AND T2.BaseLinNum=T1.BaseLine

where T0.DocEntry = 9

thanks for helping

Answers (0)