select if (meta>0,' Atingida, no ',' Nao atingida, ainda ha um negativo no') as Meta, round(meta) as " valor de R$ " from ( select sum(entradas - saidas) as Meta from ( select sum( valor_entrada - valor_saida) as Entradas, 0 as saidas from caixa_movimento where year(data) = year(current_date) and month(data) = month(current_date) union select sum(entradas), sum(saidas) from ( select if(c.tipo_conta = 'Receber',ci.valor-2.86,0) as Entradas, if(c.tipo_conta = 'Pagar',ci.valor,0) as Saidas from conta_item ci inner join conta c using(id_conta) where ci.ativo = 'S' and c.ativo = 'S' and (ci.data_pagamento is null or ci.data_pagamento = '' or ci.data_pagamento='0000-00-00') and c.tipo_conta in ('Receber','Pagar') and year(data) = year(current_date) and month(data) = month(current_date) ) as x ) as z ) as w