Hi Mary,
Please see if this works:
1) Go to the Field Explorer > Right click SQL Expression Fields > New > use this code:
(
Select Count(Distinct "T.EmployeeID") From Table T
)
The SQL needs to be enclosed in round braces and the database field needs to be surrounded by double quotes.
2) Edit the formula on the header and add this part to the existing code:
If {%Sql expression name} = ubound({?Prompt}) then
'ALL'
Else
(
<your existing code here>
)
Another way to do this is to create a SQL query via the add command option that only returns the distinct count of employees as its result. You'd then leave the command sql unjoined to the other tables and replace the SQL expression field with the field from the SQL in the formula above.
-Abhilash