Discussion Locked

TotalFigure

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Access 2000

I have a table that has entries, for example:
Microsoft
The Microsoft Corp
Building Microsoft
Microsoft 2
The Microsoft Site

5 sites, okay?
I want a query, or a report based off of this query, to count these sites and give mea total of 3. I DO NOT want the query to return:
Microsoft 1
The Microsoft Corp 1
Building Microsoft 1
Microsoft 2 1
The Microsoft Site 1

I want it, or the report, to give me this answer:
5

How can I do this query, or the query/report, to give me the total of entries?
I have tried doing a count on *microsoft* but it does not work.

7 replies

by richtee

Create a new query based on your table. Make sure the ?total? shows in your grid by going to:
View | Select ?Totals?

In the grid in the ?Totals? row: enter ?Count?

That?s all there is to show the count and not the actual data.

Good Luck
Rich

by borginva

Yes, I know that, but what about what I asked for in my question? Maybe I did not ask it correctly, but in my table, I have hundreds of sites with different names. I want to get the total of specific sites.

by richtee

In addition to my answer in #1, in the query grid, add the field in question a second time.
In total: use Group By
Uncheck the 'Show Box'
Add the following code to criteria:

Like "*" & [Enter Name] & "*"

When you run the query you will geta dialog box asking you for "Enter Name". Add the name you want to use as your parameter. Click ok. You will get the number of times this particular name appears in your table.

Good Luck
Rich

by borginva

Still give mes a list of each site's totals (even if I hide the names):

Microsoft 1
The Microsoft Corp 4
Building Microsoft 7
Microsoft2 3
The Microsoft Site 1

I am looking for the total of the criteria I choose. My answer should be 16. Nothing but "16."

by tfarrington

I'm not sure you'll like this solution, but here it goes. In your query If you want a count of only one company i.e. Microsoft based on the data you provided above. In the first field enter the following:
Expr1: Mid([namesite],InStr([namesite],"microsoft"),9)
In the second field add [namesite]
Choose group by and select count on your second field.
[namesite] is the name of your field.

Good luck
Tom

by borginva

Sorry, it did not work for me well. Another poster gave me one that helps out for me on another thread I set up, but thanks for trying.

This discussion is closed to new replies.