cancel
Showing results for 
Search instead for 
Did you mean: 

Repeated styles and quantity in SAP B1 9.1 Query

shahmed
Participant
0 Kudos
query-output.jpg

Hi Gurus,

Below query is giving me correct out on quantity but item code and item description is repeated. i want to see one time code having Total PO qty and what in stock.

Can you please advise what's wrong with this query.

Thanks

Shahzad Ahmed

SELECT

T1.[ItemCode], 
T1.[Dscription], 
sum(T1.[Quantity]) as 'PO QTY', 
T3.[OnHand] 

FROM 

ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] 
INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] 
INNER JOIN OITW T3 ON T2.[ItemCode] = T3.[ItemCode] 

WHERE

 T0.[CardCode] = 'c00192' and
    T0.[NumAtCard]  Like '818276%%'  and
    T3.[WhsCode] = '161' 

GROUP BY T1.[ItemCode], T1.[Dscription], T1.[Quantity],  T3.[OnHand] 

Accepted Solutions (0)

Answers (0)