How to convert the value of records into a table with a data type varcharin integeror decimalso that I can get the sum of the value. I use SQL Server 2005.
Let's say that I have a table structure as follows:
ID int
Stuff varchar
and records
ID = 1, Stuff = 32.43
ID = 2, Stuff = 43.33
ID = 3, Stuff = 23.22
Now I want to get the total number of columns:
SELECT SUM(convert(decimal(4,2), Stuff)) as result FROM table
But that will not work. Please, help!
source
share