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 |
|
sateesh.sqldba
Starting Member
25 Posts |
Posted - 2010-06-23 : 12:38:14
|
| i have three columns a,b,c i wan to take percentage of all threelike a/(a+b+c) * 100,b/(a+b+c)* 100 like this but i am getting 0 valuesateesh |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-06-23 : 12:42:24
|
| wat about this>a/(a+b+c) * 100.0,b/(a+b+c)* 100.0------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sateesh.sqldba
Starting Member
25 Posts |
Posted - 2010-06-23 : 12:47:11
|
[quote]Originally posted by visakh16 wat about this>a/(a+b+c) * 100.0,b/(a+b+c)* 100.0------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/getting 0.0 valuesateesh |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-06-23 : 12:49:01
|
| can you check what are values of a,b & c?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sateesh.sqldba
Starting Member
25 Posts |
Posted - 2010-06-23 : 12:52:57
|
quote: Originally posted by visakh16 can you check what are values of a,b & c?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
i have a is count valuelike a=23b=13c=14i need a/(a+b+c) * 100 this gives percentagesateesh |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-06-24 : 02:40:00
|
| 100.0*a/(a+b+c) ,100.0*b/(a+b+c)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|