counting records in a query

D

dola

I am hoping to be able to add numbers to the names I have listed in a query. For instance

1 John Do
2 Jane Smit
3 Lise Scot

So it counts the total number of people or records returned. i am sure this is possible but I can't get it to work

THANKS

DOL
 
M

Marin Kostov

First, you could add an Autonumber Field in your table, then make it Primary
Key. I will increment automatically.
Second...
Open your Query, and make it Totals (click the Sum Sign in the toolbar).
Now you will have a Totals Row in the Lower Pane.
Drag the Name Field to the lower pane, it will show Group By in the Total
Row. Then just change the Group By to Count. Run the Query, it will show the
number of records.
 
V

Van T. Dinh

If you simply want to count the number of rows returned, check Access VB
Help on the DCount() function.

--
HTH
Van T. Dinh
MVP (Access)


dola said:
I am hoping to be able to add numbers to the names I have listed in a query. For instance,

1 John Doe
2 Jane Smith
3 Lise Scott

So it counts the total number of people or records returned. i am sure
this is possible but I can't get it to work.
 

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