(select MD=IsNull(Sum(MD.TotalDoc),0) from MovCliente as MD where MD.Codigo=MovCliente.Codigo and MD.Data<=MovCliente.Data and (MD.Afecta='D+' or MD.Afecta='C-') and MD.Ano>=(select AnoCalculo from paramgeral) ) - (select MD=IsNull(Sum(MD.TotalDoc),0) from MovCliente as MD where MD.Codigo=MovCliente.Codigo and MD.Data<=MovCliente.Data and (MD.Afecta='D-' or MD.Afecta='C+') and MD.Ano>=(select AnoCalculo from paramgeral) )