Error converting data type varchar to numeric

Hi Guys,

have a case statement that giving me error how can I replace '0' with blank or '-' ?
error:
Error converting data type varchar to numeric.

Columns:
Quarter =varchar
amount= decimal
below just showing the totalQ1 only (case statement)

Thanks!

select co,empid,quarter,

,(case when QUARTER = 1 then sum(amount) over ( partition by empid, quarter) else '-' end) as totalQ1
from deduction

image

,(case when QUARTER = 1 then CAST(sum(amount) over ( partition by empid, quarter) as varchar(20)) else '-' end) as totalQ1

Thanks Lewie, just had the same solution! mine dies not have the "as varchar(20)" but I will add it.
Pasi.