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

Re: Rate of return query

$
0
0

Thanks I fixed that and now it is running. Do you know how I can get the results for both the 'Delivered' and 'Returned' quantities to display on the same line?

 

SELECT T0.[ITEMCODE], NULL AS 'Delivered', sum(T0.[Quantity]) AS 'Returned'

 

FROM RDN1 T0

INNER JOIN ORDN T1 on T0.DocEntry = T1.DocEntry

 

WHERE T1.[DocDate] >=[%0] and  T1.[DocDate] <=[%1]

 

 

GROUP BY T0.[ITEMCODE], T0.Quantity

 

UNION

 

SELECT T2.[ITEMCODE], sum(T2.[Quantity]) AS 'Delivered', NULL AS 'Returned'

 

FROM ODLN T3

INNER JOIN DLN1 T2 on T2.DocEntry = T3.DocEntry

 

WHERE T3.[DocDate] >=[%0] and  T3.[DocDate] <=[%1]

 

GROUP BY T2.[ITEMCODE], T2.Quantity


Viewing all articles
Browse latest Browse all 8357


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>