SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2020' AND month(Dt_vencimento) = '03' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2020' AND month(Dt_vencimento) = '02' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2020' AND month(Dt_vencimento) = '01' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '12' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '11' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '10' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '09' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '08' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '07' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '06' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '05' SELECT SUM(c.Vr_dup) as totdesp FROM tab_ctapagareceber c INNER JOIN tab_movnfe n ON c.Cod_interno = n.Cod_interno WHERE n.CNPJ='23523122000168' AND n.Tip_oper= 'C' AND c.Dt_pgto='0000-00-00' AND year(Dt_vencimento) = '2019' AND month(Dt_vencimento) = '04'