Grouping on an expression (and possible HAVE)
You don't have to.  You can just rewrite it to CTE/inline view , and refer by alias :

SELECT t.* FROM 
(
SELECT 
    a,
    b,
    CONVERT(int, RTRIM(' ' + UPPER(CONVERT(char, a+b))))/c as d
from #TEMP
)t
GROUP BY a,b,d
HAVING d &gt; 0 
ORDER BY 3 ;


or 

WITH cte1 AS 
(
SELECT 
    a,
    b,
    CONVERT(int, RTRIM(' ' + UPPER(CONVERT(char, a+b))))/c as d
from #TEMP
)
select t.* 
from cte1 t
group by t.a,t.b,t.d 
having t.d &gt; 0 
order by 3; 


Also, there is no need for  GROUP BY( and HAVING can be replaced by WHERE)  in this particular case - SELECT DISTINCT will do the job.