count alphabetically within a sort

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
SELECT Precinct, Left([Voter_Name],1) As Initial, Count([Voter_Name]) As
CountOfVoters FROM YourTableName GROUP BY Precinct;

Hope this helps,

Sam
 
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

Similar Threads

Count distinct addresses 1
Sorting 0
Count Question 9
Access Count dates within a Month 4
Count Within a Range 2
counting within a record 1
sort alphabetical in report 4
Running Count within a Group (Time-Zero Data) 7

Back
Top