Skip to Content
author's profile photo Former Member
Former Member

Batch Query Delivery

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 12, 2012 at 04:47 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.