Aleks
asked on
Syntax to select and return percentage
I have the two queries below. I need to combine them to get a percentage.
I want to divide the first one over the second one.
Should end up being something like 5/7 = .71
And I need to return it as a percentage like: 71%
How can I do this?
I want to divide the first one over the second one.
SELECT COUNT (activityid) AS completedcount FROM dbo.Activities
WHERE ActType = 'HISTORY' AND dateInitiated IS NOT null
AND CaseId = 13701
SELECT COUNT (activityid) AS totalcount FROM dbo.Activities
WHERE ActType = 'HISTORY'
AND CaseId = 13701
Should end up being something like 5/7 = .71
And I need to return it as a percentage like: 71%
How can I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER