counting functions

L

larry

I have a simple database with customers and sales reps,
all in one table. I would like to create a query that will
allow me to run a report that will list the customers
associated with each sales rep and also:

1. total number of customers per sales rep
2. cumulative total number of customers

thanks,
larry
 
J

John Vinson

I have a simple database with customers and sales reps,
all in one table. I would like to create a query that will
allow me to run a report that will list the customers
associated with each sales rep and also:

1. total number of customers per sales rep
2. cumulative total number of customers

thanks,
larry

How do you identify in the table which customer is associated with
which sales rep? Do you have a field in the table which identifies who
is a customer, and who is a sales rep? More info please!

John W. Vinson[MVP]
(no longer chatting for now)
 
L

larry

john,

my db comprises a single table:
[Customer]
[County of Residence]
[Sales Rep]
[Contract Date]

i realize it isn't good practice to duplicate the names of
the sales reps multiple times but i'm trying to keep this
very very simple because i'm not going to be around to
administer it. (and frankly, i'm no access wiz to say the
least.)

thanks,
larry
 
J

John Vinson

john,

my db comprises a single table:
[Customer]
[County of Residence]
[Sales Rep]
[Contract Date]

i realize it isn't good practice to duplicate the names of
the sales reps multiple times but i'm trying to keep this
very very simple because i'm not going to be around to
administer it. (and frankly, i'm no access wiz to say the
least.)

So if you have entries in the Sales Rep field like

James Maxton
Jim Maxton
Jim
Jim M.
J.R. Maxton

you want them to all be counted as the same person...?
Good luck! Of course, Access won't do that.

Assuming that these can be counted as five different sales reps,
create a Totals query based on your table. To do so, create a Query;
select Customer and Sales Rep. Change it to a Totals query by clicking
the Greek Sigma icon (looks like a sideways M). Leave the default
Group By alone on Sales Rep but change it to Count on Customer. Open
this query, and you'll see the name of each sales rep and how many
customers that rep has.

One other question: do you get any repeat business? Might the same
Customer be in your table twice? If so, do you want them counted twice
(two sales) or once (one customer)?

Frankly, I think you're doing yourself a disservice by misusing
Access. This will be much EASIER to use if the data is properly
normalized, into at least three tables:

SalesReps
RepID Autonumber
LastName
FirstName

Customers
CustomerID Autonumber
LastName
FirstName
Address
City
State
Zip
County

Sales
SaleID Autonumber
CustomerID
RepID
SaleDate
<any other info about the sale, e.g. what the person bought...?>

Some simple Forms will let you maintain this data very easily, and it
will be MUCH MUCH easier to do the kind of counts and reports you're
asking for! Work *with* Access instead of struggling against it, and
you'll find that it is much easier.

John W. Vinson[MVP]
(no longer chatting for now)
 

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