on 11-12-2012 2:43 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.