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

Counting number of records for a particular name in a field 1

Status
Not open for further replies.

topgeek

MIS
Oct 28, 2001
59
GB
I have a table which consists of the following fields:

Project Name
Sales Person
Date


We have ten sales people who's initials are put against a project that they have been allocated to.

Theres around 3,000 records and what I want to do is count how many projects a salesperson is allocated to using a query?

Any idea how I do this?
 
Something like this (SQL code) ?
SELECT [Sales Person], Count(*) As CountOfProjects
FROM yourTable
GROUP BY [Sales Person]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for responding PHV.

I've used the query:

SELECT [Sales Rep], Count(*) AS CountofProjects
FROM tblEnquiry
GROUP BY [Sales Rep];

It prompts me for a sales rep and then returns all the records in the table.

Have I missed something?
 
Have you typed this code in the SQL view pane ?
Is [Sales Rep] a field defined in the tblEnquiry table ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV

You where quite right. I wasn't referring to the correct field name.

Work fine now!

Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top