Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9155

Re: Query to Determine Total Order Quantity Invoiced per Sales Order Line

$
0
0

Hi Ron ...

 

Yes It Is Possible you can create a Object and sum  Try this

 

Select Sum(tt.QTY) from (

 

SELECT

SUM(T0.[Quantity]) as QTY FROM INV1 T0

INNER  JOIN DLN1 T1 ON T0.BaseEntry = T1.DocEntry and T0.BaseLine = T1.LineNum

  INNER  JOIN RDR1 T2 ON T1.BaseEntry = T2.DocEntry and T1.BaseLine = T2.LineNum

WHERE

T2.[DocEntry] = 19 and T0.BaseType = 15 and T1.BaseType = 17

  UNION all

   

SELECT

SUM(T0.[Quantity]) as QTY FROM INV1 T0

INNER JOIN RDR1 T2 ON T0.BaseEntry = T2.DocEntry and T0.BaseLine = T2.LineNum

WHERE T2.[DocEntry] = 19 and T0.BaseType = 17 )

as TT

 

 

Hope Helpful

 

Regards

Kennedy


Viewing all articles
Browse latest Browse all 9155