Home Forums SQL Server 7,2000 T-SQL Conversion failed when converting the varchar value '98.97%' to data type int. RE: Conversion failed when converting the varchar value '98.97%' to data type int.

  • Ok so here is the new code, it works but the problem is that the output for Compliance % is 98 and I want two decimal places after 98

    set @percent = (CONVERT(DECIMAL (4,2),100.0 *

    (select [# of Patches] from vpatchcompliancecount where Status = 'compliant')/(select SUM([# of Patches]) from vpatchcompliancecount)))