SELECT C.Type, C.Comp_ID, C.Year, C.Comp_Name, C.Phone, COUNT(E.CompID) AS EmpCount, SUM(E.Wages) AS Wages, SUM(E.FedTax) AS FedTax
FROM Com$ AS C INNER JOIN
Emp$ AS E ON C.Comp_ID = E.CompID AND C.Year = E.Year
WHERE (C.Year = @YearParam)
GROUP BY C.Comp_ID, C.Type, C.Year, C.Comp_Name, C.Phone
ORDER BY C.Comp_ID
|