query help

G

Guest

Sorry about the generic subject line but couldn't come up with short
description :O.

A table has some records such as.
Account Rep Division
A John 2
B Joe 3
B Sue 3
C Mary 1
C Bill 2

I would like query to count the number of accounts that have more than 1
department - such as with Account C. I would not want Account A included
because there is only 1 rep involved and would not want Account B included
because both reps are in the same Division.

I know how this could very easily be done in Excel but any ideas how to do
this in Access?
 
G

Guest

Use these two queries ---
maryj_1 ---
SELECT maryj.Account, maryj.Division
FROM maryj
GROUP BY maryj.Account, maryj.Division;

SELECT maryj_1.Account
FROM maryj_1
GROUP BY maryj_1.Account
HAVING (((Count(maryj_1.Division))>1));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top