Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-03-12 : 09:38:08
|
| Hi--Got a column with int value and I need to sum the entire column by converting to a numeric.-- here what I haveselect isnull(convert(varchar(15),sum(cast(columnName as numeric))),'0.00') from myTable-- But my outcome doesnt have decimal 0.00any help?Josephine |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-12 : 09:42:12
|
Why you again converting to varchar?select isnull(sum(cast(columnName as numeric(12,2))),0.00) from myTable Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-03-12 : 10:06:35
|
Thank u Harsh. It works!!quote: Originally posted by harsh_athalye Why you again converting to varchar?select isnull(sum(cast(columnName as numeric(12,2))),0.00) from myTable Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
Josephine |
 |
|
|
|
|
|