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

Re: Total Revenue by Business Partner Including Freight

$
0
0

Try:

 

SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], sum(T0.[DocTotal]) FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocDate]  between [%0] and [%1]

 

 

group by

T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription]

 

 

union all

 

 

SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], -sum(T0.[DocTotal]) FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocDate]  between [%0] and [%1]

 

 

group by

T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription]


Viewing all articles
Browse latest Browse all 8851

Trending Articles



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