You can do this using window functions. Window functions can be nested in aggregations, so:
SELECT Manager,
COUNT(IndID) as EmployeeCount,
SUM(CASE WHEN TermDate BETWEEN @StartDate AND @EndDate THEN 1 ELSE 0 END) as Terminations,
SUM(COUNT(*)) OVER () as TotalEmployees
FROM myTable
WHERE HireDate <= @EndDate AND TermDate BETWEEN @StartDate AND @EndDate OR
StartDate <= @EndDate AND TermDate IS NULL
GROUP BY Manager;
I didn't think you needed COUNT(DISTINCT)
for EmployeeCount
, so I removed the DISTINCT
.