Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acc 2010 Group query, by Need to get Count of all records

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
this returns results for each counrty such as
EmployeeCount, Country
34, FR
5, GB
How can I get a total of all countries say 39 in this case, on one line?
So if it's not USA then give me one record with the total of 39, instead of each in a separate record?
EmployeeCount
39
If I leave out the Country in the Group by it gives error.. left out country as part of aggregate.
Code:
SELECT .Report1, Count(Report1) AS EmployeeCount, [Empl/Conr]
FROM [ReportTree$]
GROUP BY Report1, [Empl/Conr],Country
HAVING (((Empl/Conr])='Employee') AND (([Report1])=Lname, fname) AND (([Country])<>'USA'));

DougP
 
SQL:
SELECT Count(*) AS EmployeeCount
FROM [ReportTree$]
WHERE [Empl/Conr]='Employee' AND Country<>'USA'
I'm not sure about the criteria on Report1 ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top