declare @Cte1_count INT = 2 declare @Cte2_count INT = 500 select (@Cte1_count/CONVERT(FLOAT, @Cte2_count))*100 result ---------------------- 0.4 (1 row(s) affected)
declare @Cte1_count int = 2 declare @cte2_count int = 500 declare @dec decimal (6,2) SET @dec = (CAST(@Cte1_count AS Float)/CAST(@cte2_count AS FLoat))*100 print @dec
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)