I have created a query in which there is a column that calculates a percentage:
SELECT
u.User_FirstName
,l.[Total Leads]
,SUM(s.SalesCount) AS [New Clients]
,c.Target
,CONVERT(VARCHAR, CONVERT(DECIMAL(11,0),ROUND((CONVERT(DECIMAL(11,2), SUM(s.SalesCount)) / l.[Total Leads]) * 100, 0))) + '%'
As you can see, that last column is my percentage column, which uses a lot of CONVERT
. I was wondering if there is a simpler or faster way to get a two-digit percentage in SQL Server 2008.
SalesCount
andTotalSales
are integers? \$\endgroup\$