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 |
|
harlingtonthewizard
Constraint Violating Yak Guru
352 Posts |
Posted - 2008-10-08 : 00:06:27
|
| I have the following, which returns 33.33' mathematically however this query returns 0.0. Just think of it as two numbers and I need percentage:)SELECT EventswithComments / Total * 100(In my test query this would be 4/12*100)EventswithComments and Total are calculated with:SELECT Count(*)As Total, Count (OverLapSum.EventID) As EventswithComments |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-08 : 00:14:45
|
| SELECT EventswithComments * 100.0/ Total |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-08 : 00:16:11
|
| reason is thishttp://sqlblogcasts.com/blogs/madhivanan/archive/2008/01/16/beware-of-implicit-conversions.aspx |
 |
|
|
|
|
|