Lo siento, la consulta no funciona.
Necesito una consulta como:
SELECT T3.ItmsGrpNam ,SUM(T5.Quantity)-SUM(T5.Quantity) as ' kg Cantidad Cotización de Venta ',SUM(T5.Quantity)-0 as ' kg Cantidad Pedido de Venta '
FROM OITM T0
INNER JOIN OITB T3 ON T3.ItmsGrpCod = T0.ItmsGrpCod
INNER JOIN RDR1 T5 ON T5.ItemCode = T0.ItemCode
INNER JOIN ORDR T4 ON T4.DocEntry = T5.DocEntry AND T4.CardCode = 'C004885'
GROUP BY t3.ItmsGrpNam
UNION ALL
SELECT T3.ItmsGrpNam , SUM(T6.Quantity) as 'kg ofertados',SUM(T6.Quantity)-SUM(T6.Quantity) as 'kg vendidos'
FROM OITM T0
INNER JOIN OITB T3 ON T3.ItmsGrpCod = T0.ItmsGrpCod
INNER JOIN QUT1 T6 ON T6.ItemCode = T0.ItemCode
INNER JOIN OQUT T7 ON T7.DocEntry = T6.DocEntry AND T7.CardCode = 'C004885'
GROUP BY t3.ItmsGrpNam
ORDER BY T3.ItmsGrpNam
... pero sin UNION ALL