d) sQrySum=select '', '', 'A Receber / Recebido / Total ++ ', cast(sum(a.nVenc-a.nPgmto) AS NUMERIC(15,2)), cast(sum(a.nPgmto) AS NUMERIC(15,2)), cast(sum(a.nVenc) AS NUMERIC(15,2)), '', '' from FIN_Titulos a left join TOper d on a.pTOper = d.pPId and d.iVer = d.iVAt left join CC g on a.pCC = g.pPId and g.iVer = g.iVAt left join CUP h on g.pAgencia = h.pPId and h.iVer = h.iVAt left join Banco i on h.pBanco = i.pPId and i.iVer = i.iVAt left join Tipo_Cobrancas e on a.pTipoCob = e.pPId and e.iVer = e.iVAt left join Ordens r on a.pOrdem = r.pPId and r.iVer = r.iVAt and r.lExc=0, CUP b left join GrupoCUP j on b.pForGrupo = j.pPId and j.iVer=j.iVAt, CUP c left join GrupoCUP l on c.pCliGrupo = l.pPId and l.iVer=l.iVAt where a.iVer = a.iVAt and a.pCedente = b.pPId and b.iVer = b.iVAt and a.pSacado = c.pPId and c.iVer = c.iVAt and a.lExc = 0 and a.jTipo = 0 and a.pPId >= 4654009 and a.pPId <= 4654009 and a.lPrevisao in (0,1)
c) sQrySum2=select '', '', 'Marcados', cast(sum(a.nVenc-a.nPgmto) AS NUMERIC(15,2)), cast(sum(a.nPgmto) AS NUMERIC(15,2)), cast(sum(a.nVenc) AS NUMERIC(15,2)), '', '' from FIN_Titulos a where a.iVer = a.iVAt and a.lExc = 0 and a.pPId in (0,0) and a.jTipo = 0