
October 10th, 2009, 12:35 PM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 1
Time spent in forums: 32 m 28 sec
Reputation Power: 0
|
|
|
MS DB Query
I am new to this so I apologize if the answer is real simple. What I am looking to do is:
I have a table with TaskName and TaskPercentComplete in it. The task names have many tasks that start with 'Application' and many that start with 'Infrastructure'. (Example - Application abc, Application def, Application ghi and so on, the same is true for Infrastructure tasks) What I want to do is for all tasks that start with 'Infrastructure' to give the percent complete. And for all tasks that start with 'Application' to give the percent complete. I have this working for just 'Application' or just 'Infrastructure', but I cannot figure out how to get it for both to show at same time.
The sql statement I have is:
SELECT COUNT(*) AS CNT, SUM(TaskPercentCompleted) AS TaskPercentSum, SUM(TaskPercentCompleted) / COUNT(*) AS AvgTaskPercent
FROM MSP_EpmTask
WHERE TaskName LIKE 'Infrastructure%' and TaskOutlineLevel <2
Example of what I need the output to be is:
Applications 85%
Infrastructure 65%
Any help would be greatly appreciated.
Thanks,
Josh
|