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
 Other Forums
 Other Topics
 Problem calculating percentage

Author  Topic 

joszovko
Starting Member

2 Posts

Posted - 2011-08-24 : 04:25:52
I'm trying to calculate percentage of some amount using SQL Server 2008.
Let's say I need 50 percent of 700.

I tried with "select 700-(700*(50/100))" but I get the result 700.

is there any other way to do this or why this query does not work???

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-24 : 04:27:25
select 700.0-(700.0*(50.0/100.0))

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-24 : 04:28:35
also read

http://beyondrelational.com/blogs/madhivanan/archive/2008/01/16/beware-of-implicit-conversions.aspx


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

joszovko
Starting Member

2 Posts

Posted - 2011-08-24 : 05:44:03
Thanks. It was helpful.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-24 : 05:45:18
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -