Count Query

pdbowling

Registered User.
Local time
Today, 16:44
Joined
Feb 14, 2003
Messages
179
Hi all,
I have a query that returns a list of ten items.

Select distinct(departmentInfo.Dept)
FROM departmentInfo;

Is there a way to modify this query to give me the count rather than the list (in one query, I'm trying not to break it up)

I'm just looking for a result of '10'.

Thanks everyone.
PB
 
A totals query with the field set to Count:

SELECT DISTINCT Count(departmentInfo.Dept) AS CountOfDept
FROM departmentInfo;
 
Thanks

I wasn't sure how the nesting should go.
PB
 
Sorry, I don't understand. I thought you didn't want the list, only the count.
 
Combine the queries

To accomplish the same in one query use query 1 as a subquery in the from statement:

SELECT Count(DaJob) AS DaCount
FROM( SELECT DISTINCT [YourTable].[YourField] AS DaJob
FROM [YourTable]);
 

Users who are viewing this thread

Back
Top Bottom