You see the case of SQLs auto-convert. On the same command you have
aa
and
0
, so SQL try to bring them to the same type. The final type is decided by the last element which is 0 in your case, an integer. However
aa
is not integer (and somewhere has a value of 310.2) so SQL fails to convert. Change 0 to 0.0 to solve your problem...
sum (case when [Month] = 1 then aa else 0.0 end) January,