i get an error when executing ,
Select sum(ToDouble(Jan_Hours)) from employeepayments
where Employer_Number = '2346' and [Year] = '2005'
the Jan_Hours is an varchar type of column.
how to get sum(Jan_Hours) + sum(Feb_hours) +
i also need sum (sum(Jan_Hours) + sum(Feb_hours))
Query ::
Select sum(convert(decimal(10,2), Jan_Hours))
from employeepayments
where Employer_Number = '2346' and [Year] = '2005'
Error ::
Server: Msg 8114, Level 16, State 5, Line 2
Error converting data type varchar to numeric.
i am working on imported database , so i cannot chnage the datatype of Jan_Hours to int.