SQL is not my forte, but I'm working on it - thanks for the answers.
I am working on a report that will return the percentage of completion of services for individuals in our contracts. There is a master table "Contracts", each individual Contract can have several services from the table "services", each service has several standards for the table "standards", which records the percentages filled for each standard.
I calculated the full percentage for each individual service for a particular contract Contract_ServiceID, but how can I return all the percentage of services for all contracts? Something like that:
Contract
abc abc Company Service 2 100%xyz Company Here is what I still have:SELECT
Contract_ServiceId,
(SUM(CompletionPercentage)/COUNT(CompletionPercentage)) * 100 as "Percent Complete"
FROM dbo.Standard sta WITH (NOLOCK)
INNER JOIN dbo.Contract_Service conSer ON sta.ServiceId = conSer.ServiceId
LEFT OUTER JOIN dbo.StandardResponse standResp ON sta.StandardId = standResp.StandardId
AND conSer.StandardReportId = standResp.StandardReportId
WHERE Contract_ServiceId = '[an id]'
GROUP BY Contract_ServiceID
It's me too:
Contract_serviceid Percent Complete
[id] 100%EDIT: Tables did not appear in the message.
source
share