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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|