Here is one way, but you may want to cast the columns as float if you are expecting decimals:
Code:
select 'calculated value' = case when isnumeric(columnA) and isnumeric(columnB) then cast(columnA as int)+cast(columnB as int) else 'Not numeric' end
from table1
Thanks a lot guys!
I also found why it didnt work for me. I imported data from a text file and first line was the titles...
Thats why i couldnt implement any cast to numeric. At least i can use your suggestions that broaden my ability to make conversions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.