Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Multiple Results In Query

Hello Experts

I have a query and I seem to have a problem with it

The problem is I am getting multiple results when I run it

Can someone please have a look and advise where it's wrong and cause it to give multiple results

The query is as below

SELECT T0.[DocNum] as 'Prod Order #',

T0.[U_CustName],

T0.[PlannedQty] as 'Qty',

T0.[ItemCode],

T2.[ItemName] as 'Product Description',

T1.[PlannedQty],

T0.[Comments]

FROM OWOR T0  INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode

WHERE T1.[ItemCode]  <> 'SUNDRY LABOUR' and t1.docentry NOT IN ( select t1.docentry from wor1 t1 where t1.itemcode = 'SUNDRY LABOUR') and T1.[ItemCode]  <> 'OUTSOURCED' and t1.docentry NOT IN ( select t1.docentry from wor1 t1 where t1.itemcode = 'OUTSOURCED') and 

T0.[Status] not in ( 'C','L') and  T0.[DueDate] between [%0] and [%1] 

GROUP  by T0.[DocNum],

T0.[U_CustName],

T0.[PlannedQty],

T0.[ItemCode],

T2.[ItemName],

T1.[PlannedQty],

T0.[Comments]

ORDER BY T0.[DocNum]

In the result of the query

I am getting multiple results for the WOR1 [PlannedQty] column

I think the query is getting confused with the OWOR [PlannedQty] & the WOR1 [PlannedQty]

Any suggestion on how I can fix this issue?

Thanks and Regards

Rahul

Tags:
Not what you were looking for? View more on this topic or Ask a question