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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 calculate percentage Problem

Author  Topic 

houdinitx
Starting Member

1 Post

Posted - 2009-10-21 : 18:03:00

New to SQL how do you calculate percentages?

  $sql92 = "SELECT round((SUM(Fire_Bombs) / SUM(Fire_Bombs))*100) AS bbt  FROM logger_coop_stats WHERE Name = '$dropdown'";

$result92 = sql_query($sql92, $db);

$rows92 = sql_fetch_row($result92, $db);
$bbt = $rows92['bbt'];


and how do you deal with Fire_Bombs when it equals 0?

Thanks For Your Time and help

Mike

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-10-21 : 18:56:33
This is a Microsoft SQL Server forum. Perhaps you'd have better luck in www.dbforums?

Jim


Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -