When I use ‘order by’, SQL Server orders the percentages as shown in the first screenshot. When I try converting to float using the code
convert(float, format(cast(sum(case when HHA_Rank = 7 then 1 else 0 end) as float)/cast(count(*) as float), 'P2')) State_Sustained_Hotspot_Percentage
I get the error message shown in the second screenshot. Please advise.