A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how to count specific values only not total count



 
 
Thread Tools Display Modes
  #1  
Old December 9th, 2009, 03:14 AM posted to microsoft.public.access.queries
steven
external usenet poster
 
Posts: 287
Default how to count specific values only not total count

I am using Access 2000 - I have one column of numbers (probably 1000 numbers
in total) ranging from 1 to 9 - Does anyone know how I can count the times
that each specific number appears - for instance - count the total number of
ones, count the total number of two's, three's, four's etc.

I have tried this in a query and have not yet been successful - does it need
to go only in a report?

Thank you very much - Steven
  #2  
Old December 9th, 2009, 10:09 AM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 744
Default how to count specific values only not total count

On Dec 8, 9:14*pm, steven wrote:
I am using Access 2000 - I have one column of numbers (probably 1000 numbers
in total) ranging from 1 to 9 - Does anyone know how I can count the times
that each specific number appears - for instance - count the total number of
ones, count the total number of two's, three's, four's etc.

I have tried this in a query and have not yet been successful - does it need
to go only in a report?

Thank you very much - Steven


use a totals query.

SELECT Value, Count(Value)
FROM MyTable
ORDER BY Value
GROUP BY Value;
  #3  
Old December 9th, 2009, 10:57 AM posted to microsoft.public.access.queries
RonaldoOneNil
external usenet poster
 
Posts: 345
Default how to count specific values only not total count

You can do it in a query. Put the field that contains the numbers into a
query twice.
Click on the Sigma (totals) button on the query toolbar. You will see total
row appear in your query grid with gruoup by set as default. Leave the first
group by alone but change the 2nd one to Count.

"steven" wrote:

I am using Access 2000 - I have one column of numbers (probably 1000 numbers
in total) ranging from 1 to 9 - Does anyone know how I can count the times
that each specific number appears - for instance - count the total number of
ones, count the total number of two's, three's, four's etc.

I have tried this in a query and have not yet been successful - does it need
to go only in a report?

Thank you very much - Steven

  #4  
Old December 9th, 2009, 11:09 AM posted to microsoft.public.access.queries
Brian
external usenet poster
 
Posts: 1,396
Default how to count specific values only not total count

Ensure that your table has at least one more field (besides the number, and
you can create one by simply adding an AutoNumber field to the table), then
do this:

Create a query, adding the number field and any other field to it. Click the
Sum button (Greek Sigma, somewhat like a capital E). Then change the Total to
GroupBy for the number field and Count for the other one. The Count result
will be the # of occurences of each number.

If your query has only the one field, you can do the same thing, but after
grouping by the number field, add another field: RecordCount: Count(*) with
Total as Expression (Access will not let you add the * summary by
double-clicking it)
"steven" wrote:

I am using Access 2000 - I have one column of numbers (probably 1000 numbers
in total) ranging from 1 to 9 - Does anyone know how I can count the times
that each specific number appears - for instance - count the total number of
ones, count the total number of two's, three's, four's etc.

I have tried this in a query and have not yet been successful - does it need
to go only in a report?

Thank you very much - Steven

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.