How to remove percentage in sql server

0

this is my query

porcentaje = isnull((
        select sum(x.valor)*100/(select sum(ccc.Valor)
                from CuentasPorCobrar ccc)
                from CuentaCorriente x
                    where   x.Detalle like 'Pago%'
                    ),0)

x.Value = -5250.00

ccc.Value = 1000.00 the resutal that launches me is: -525.00

but I want to get the percentage = 19.04

    
asked by Rodrigo Rodriguez 28.09.2017 в 18:21
source

1 answer

0

good, I hope you serve

porcentajeIngCuen = isnull((
select sum(ccc.valor)*100/(select sum(x.Valor)*-1
        from CuentaCorriente x
            where   x.Detalle like 'Pago%')
        from CuentasPorCobrar ccc
            ),0),
    
answered by 23.10.2017 / 23:44
source