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)))