HELP: Counting identical items in a table

# Thread: HELP: Counting identical items in a table

1. Senior Member
Join Date
Dec 1969
Posts
110

## HELP: Counting identical items in a table

Hello, (already thanks for reading!)<BR><BR>I&#039;m not very used to SQL, so that&#039;s why I am asking your help because searching the internet didn&#039;t provide the solution.<BR><BR>I have an online .mdb which holds some kind of data collected from a pol.<BR>The table has 2 fields and emailaddress and a vote field. De vote field is a number between 1 and 7.<BR>Now I want to display some kind of stats, but for that I must know how many entries there are in the table but especially how many votes of eacht number (1 to 7) there are!!<BR>Please help me...<BR>A link is welcome too!!<BR><BR>THANKS IN ADVANCE!

2. Member
Join Date
Dec 1969
Posts
78

## RE: HELP: Counting identical items in a table

SELECT COUNT (*) FROM table WHERE vote = 1<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
110

## RE: HELP: Counting identical items in a table

Thanks this works!!!!!!<BR>But can I use a second recordset that then contains "WHERE vote = 2"?<BR><BR>Like: but that does not work:<BR>SELECT COUNT (*) FROM table WHERE vote = 1, COUNT (*) FROM table WHERE vote = 2 ........<BR>

4. Senior Member
Join Date
Dec 1969
Posts
110

## RE: HELP: Counting identical items in a table

I mean a second record, not recordset, sorry for confusion!

5. Senior Member
Join Date
Dec 1969
Posts
110

## FOUND IT

I HAVE FOUND IT:<BR><BR>Select vote,sum(1) FROM table GROUP BY vote ORDER BY VOTE<BR><BR>in a recordset<BR>rs(0) contains the voteid (1 till 7)<BR>rs(1) contains the amount of votes for that ID<BR><BR>Save this query you might need it someday :)<BR><BR>Vincent

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•