>>COUNT(Distinct paEmKey) AS EmployeesCount >>>>I also need another count, but that would be based on a condition of another field.
>>CASE Balance <> 0.00 THEN COUNT(Distinct paEmKey) ELSE 0 END AS EmployeesCountWithBalances >>>>I thought perhaps a subquery, but maybe there is a better way?
>SELECT count(distinct(case when Balance <> 0 then paEmKey END)) as DistinctCountClientsWithBalance from ...Thanks, but unfortunately the result is just a count without the distinct.