count instances of a name(s)

  • Thread starter Thread starter Daren
  • Start date Start date
D

Daren

I have a simple database that's created by a web page
created with FrontPage. The single table has a
field "car". I'm trying to find a way, with a query, to
count how many times a name (like Bob) appears in the
table. Possibly even run a query that would display how
many times every name appears. Is this possible. Thanks
for any help.

Daren
 
Daren,

This is called a Totals Query. Make a query based on your table. If
you are using the query design view, add the Car field to the query
design grid, and also the table's primary key field. Make it a Totals
Query (select Totals from the View menu). In the Totals row of the
Grid, leave Group By in the Car field, and enter Count in the primary
key column. Run the query... it should show you the number of
occurrences of each name in the table. Mind you, I've never heard of a
Car named Bob before.
 
Something like:

SELECT UserName, Count(*)
FROM MyTable
GROUP BY UserName

To build such a query through the query builder interface, drag the name
field plus another field (ideally the primary key) into the grid. Convert
the query into a Totals query (Views | Totals from the menu bar), and change
the word "Group By" under the other field to "Count" (in the row marked
"Total")

If you really only want the count of Bob, put "Bob" as the criteria under
the name field.
 
Thanks guys for all the help. This will get me what I
want. Thanks again for your time.

Daren
 
Back
Top