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 |
henryparsons10
Starting Member
23 Posts |
Posted - 2008-06-05 : 14:48:06
|
I am trying to divide two statements...Like thiscount(table.column)/count(table.column) As PercentageMy return set is either a '1' or a '0'So, it only returns 1 where the formula equals 100 (percent in this case) and it is returning 0 for all other. I am assuming it is only returning the whole number without any decimal. I really want to get the data as a percent. Can anyone help. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-05 : 14:51:17
|
1.0*count(table.column)/count(table.column) As PercentageMadhivananFailing to plan is Planning to fail |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-06 : 10:43:52
|
Madhi has written a blog on this:-http://sqlblogcasts.com/blogs/madhivanan/archive/2008/01/16/beware-of-implicit-conversions.aspx |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|