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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count By Group 2

Status
Not open for further replies.

abradford

MIS
Oct 12, 2006
31
0
0
US
I have a query which displays user records from different offices. I would like a total number to be displayed in a column, so it counts number of active users per office, Based on office number.

It should look like this:

Office Name Count
a steve 2
a bob 2
b Gary 1
c Tom 3
c barb 3
c terry 3

Right now my count column is returning all 1's. I am using the sigma symbol and count in the total field of office column. What am I missing here?

Thanks
 
You will have to leave out the 'Name' column, if you want a total by office.
 
Looks like you're grouping by office AND name. In other words, you're counting the number of 'bob' in office a, the number of 'Steve' in office a, etc. Remove the group by name and you'll get:
[tt]
a 2
b 1
c 3[/tt]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top