Código SQL:
Ver originalSELECT campo1-campo2 AS campo_resta FROM(
SELECT T3.[ItemCode], T3.[Dscription], T2.[CardCode], T2.[CardName], Cantidad=SUM(T3.[Quantity]), T3.[unitMsr], Total=SUM(T3.[TotalSumSy]) FROM [dbo].[OINV] T2 INNER JOIN [dbo].[INV1] T3 ON T2.DocEntry = T3.DocEntry WHERE T2.[DocType]<>'S' AND T2.[DocDate] >= '[%0]' AND T2.[DocDate] <= '[%1]' GROUP BY T3.[ItemCode], T3.[Dscription], T2.[CardCode], T2.[CardName], T3.[Quantity], T3.[unitMsr], T3.[TotalSumSy] ORDER BY T3.[ItemCode]
UNION
SELECT T1.[ItemCode], T1.[Dscription], T0.[CardCode], T0.[CardName], Cantidad=SUM(T1.[Quantity]), T1.[unitMsr], Total=SUM(T1.[TotalSumSy]) FROM ORIN T0 INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocType]<>'S' AND T0.[DocDate]>='[%0]' AND T0.[DocDate]<='[%1]' GROUP BY T1.[ItemCode], T1.[Dscription], T0.[CardCode], T0.[CardName], T1.[Quantity], T1.[unitMsr], T1.[TotalSumSy] ORDER BY T1.[ItemCode]
) tabla
algo asi :)
saludos!