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 |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-04-12 : 14:34:55
|
| The broswer percent is coming out as 0 for all the records. a.browsertotal and a.total are all more then 0,so it rounds it down or something?SELECT a.total, b.browsertotal, b.browsers, (b.browsertotal / a.total) * 100 AS browserpercentFROM (SELECT Count(id) As total FROM tblbrowsers) a, (SELECT count(id) as browsertotal, browsers FROM tblbrowsers GROUP BY browsers) |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-04-12 : 14:36:46
|
| SELECT a.total, b.browsertotal, b.browsers, (b.browsertotal / a.total*1.00) * 100 AS browserpercentBrett8-) |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-04-12 : 14:40:47
|
| Still comes out as 0, if i multiple instead of divide, then its not zero, but I have to divide in order to create the percent |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-04-12 : 14:59:42
|
| DECLARE @x int, @y intSELECT @x = 1, @y = 2SELECT @x*1.00/@yBrett8-) |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-04-12 : 15:05:09
|
| That's way beyond me :) Will I be able to do that in EM or do I need to use QA? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-04-12 : 15:30:02
|
| QA.....where are you doing development then? In EM?You should do all of your developement in Query Analyzer, saving each sproc as a .sql file.Brett8-) |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-04-12 : 15:41:04
|
| Yes, I usually use EM except if I am writting a sp. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-04-12 : 15:44:52
|
| Well...open up QA and BOL and leave them open......Down with GUI'sBrett8-) |
 |
|
|
|
|
|
|
|