count alphabetically within a sort

G

Guest

I have a table of which two of the fields are 'Precinct' and 'Voter_Name'.
There are a total of 126 precincts and I want to produce a report that counts
the number of voter names alphabetically within each precinct.

The report should give results like this:
A B C D
1 90 123 54 119
2 145 69 78 345
3 79 101 65 88

with column headings being the beginning letters of voter names and the row
headings being the precinct number, and the data as a count of each

How can this be achieved?
 
O

OfficeDev18 via AccessMonster.com

SELECT Precinct, Left([Voter_Name],1) As Initial, Count([Voter_Name]) As
CountOfVoters FROM YourTableName GROUP BY Precinct;

Hope this helps,

Sam
 
D

Duane Hookom

Create a crosstab query with Precinct as the Row Heading,
Left([Voter_Name],1) as the Column Heading, and Count([Precinct]) as the
Value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top