From: Snedker on 18 Mar 2010 17:59 How do I get: SELECT ((127/153)*100) AS percentage to return 83 (or so)? Regards /Morten
From: nj on 18 Mar 2010 18:07 select cast((127*1.0/153*1.0) * 100 as int) as percentage
From: Eric Isaacs on 18 Mar 2010 18:15 DECLARE @Value DECIMAL(10,2) SET @Value = CONVERT(DECIMAL(10,2), 127) / CONVERT(DECIMAL(10,2), 153) * 100 SELECT @Value OR SELECT (127 * 100)/(153) -Eric Isaacs
From: Michael Coles on 18 Mar 2010 23:47 Add a .0 to the 127. SELECT ((127.0/153)*100) -- Thanks Michael Coles SQL Server MVP Author, "Expert SQL Server 2008 Encryption" (http://www.apress.com/book/view/1430224649) ---------------- "Snedker" <morten.snedker(a)gmail.com> wrote in message news:96aa67a5-823f-4b8f-9697-a3b04c1f3908(a)q15g2000yqj.googlegroups.com... > How do I get: SELECT ((127/153)*100) AS percentage > to return 83 (or so)? > > Regards /Morten
|
Pages: 1 Prev: Like Operator with Wildcard Next: Connect to SQL Express 2008 on local machine |