Skip to Content
0

Query results in two figures I just want totalled sum - i.e.435566.29. Please help!

Jun 23, 2017 at 08:10 AM

18

avatar image

sap-b1-query.jpgSELECT sum ([linetotal]) FROM ( SELECT sum(t1.[LineTotal]) as 'linetotal' FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode WHERE t0.taxdate >= '20170101' and t0.taxdate <= '20170131' and t0.[canceled] ='n' and T0.[SlpCODE] = '4' union all SELECT sum(-T1.[LineTotal] ) as 'linetotal' FROM ORIN T0 INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode WHERE t0.taxdate >= '20170101' and t0.taxdate <= '20170131' and t0.[canceled] ='n' and T0.[SlpCODE] = '4' ) as a group by a.linetotal

sap-b1-query.jpg (54.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers