cancel
Showing results for 
Search instead for 
Did you mean: 

Query for Sales Order Remaining Open Quantity

former_member224264
Participant
0 Kudos
989

Greetings of the day.

Am trying to create a query for Sales Order, Sum of Row Total of Remaining Open Quantity grouped by BP Code and Open Quantity Total. Want only the Document Number, Card Code and Amount.

SELECT T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[OpenQty], T1.[Price] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocDueDate] < (getdate() -14) AND T1.[LineStatus] = 'O' group by T0.[CardCode], T0.[CardName]

Can anyone help me please.

Regards.

View Entire Topic
narayanis
Active Contributor
0 Kudos

I am glad that I was of some help to you.