y si haces:
Código SQL:
Ver originalSELECT concepto,SUM(importe) AS total FROM
(
SELECT C.CAPITULO, C.PARTIDA, GBL.IDTIPNOM, GBL.UNIRES, C.CONCEPTO_DESC, SUM(GBL.TRAIMP) AS IMPORTE, '01' AS INDICADOR FROM dbo.CONCEPTOS AS C INNER JOIN
dbo.GBL2013 AS GBL ON C.TRACVE = GBL.TRACVE AND
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(C.TRADAT, 0, ''), 1, ''), 2, ''), 3, ''), 4, ''), 5, ''), 6, ''), 7, ''), 8, ''), 9,
'') = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(GBL.TRADAT, 0, ''), 1, ''), 2, ''), 3, ''), 4, ''), 5, ''), 6, ''), 7, ''), 8,
''), 9, '')
WHERE (GBL.TRATIP LIKE '1') AND (GBL.QNAPROC IN (1, 2)) AND (GBL.IDTIPNOM LIKE '1') AND (GBL.UNIRES LIKE 416)
GROUP BY GBL.IDTIPNOM, GBL.UNIRES, C.CONCEPTO_DESC, C.CAPITULO, C.PARTIDA, GBL.QNAPROC
) t1 GROUP BY concepto
no te funciona???