ScotWilder
New member
- Local time
- Today, 06:50
- Joined
- Sep 6, 2009
- Messages
- 3
Hi folks,
Having a major head scratch moment with percentages in t-sql output, I need the end result of a count 1/count 2 output to be a percentage value of 00.00% (e.g. two decimal places.
The result of this example should be count 1 (14) / count 2 (146) = 9.59%
I've seen a separate thread to do with updates using percentages but it's not clicking I'm afraid and attempts to put formatting in have failed hence it doesn't have anything around to calculate percentage, any help gratefully received!
:banghead:
Having a major head scratch moment with percentages in t-sql output, I need the end result of a count 1/count 2 output to be a percentage value of 00.00% (e.g. two decimal places.
The result of this example should be count 1 (14) / count 2 (146) = 9.59%
I've seen a separate thread to do with updates using percentages but it's not clicking I'm afraid and attempts to put formatting in have failed hence it doesn't have anything around to calculate percentage, any help gratefully received!
:banghead:
SELECT (SELECT COUNT(PROSPECTACTION.PROSPECTACTIONID) AS 'Ask/Close'
FROM PROSPECTACTION LEFT OUTER JOIN
PROSPECT ON PROSPECTACTION.SERIALNUMBER = PROSPECT.SERIALNUMBER
WHERE (PROSPECT.PRIMARYFUNDRAISER = 'jillians') AND (PROSPECTACTION.STAGE IN ('5 - Ask','6 - Close')))/(SELECT COUNT(PROSPECTACTION.PROSPECTACTIONID) AS 'Total Prospects'
FROM PROSPECTACTION LEFT OUTER JOIN
PROSPECT ON PROSPECTACTION.SERIALNUMBER = PROSPECT.SERIALNUMBER
WHERE (PROSPECT.PRIMARYFUNDRAISER = 'jillians')) AS 'CalculatedPercentage'/QUOTE]