Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count of field hits 2

Status
Not open for further replies.

toyt78

Technical User
Apr 5, 2005
125
US
I have information:

ID value
1 1
2 1
3 2
4 1
5 3
2 2

I need to get a count of how many times each value occurs:
1 occurs 3 times
2 occurs 2 times
3 occurs 1 time

The sql here gave me a value but not the total number of occurences of each value in the Access 2000 database:
Code:
select count(value) as theValue
from Project
 
select count(value) as theValue
from Project GROUP BY value

-DNG
 
i think it is

select count(value) as theValue
from Project GROUP BY ID

-DNG
 
I think it should be

Code:
SELECT value, count(value) AS CountOfValue
FROM Project GROUP BY value;

HTH,
fly

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
[blue]Shared Database_Systems and _Applications across all Business_Areas[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top