Counting Text Entries In Query

J

Jason k

I am creating a query in access that I want to count information from an
excel spreadsheet. One of my columns has majors of college students. I want
to count how many have chosen the major "Undecided" in my query. When I go to
count or Sum in Totals it tells me mismatch error. Is there a way to count
text entries from an excel spreadsheet? ex. if there are 3 undecided major I
want it to just say "3" when I execute the query. Thanks.
 
J

John Spencer

Since you didn't post what you tried, we can only guess at a solution. In
the query grid that might look like

Field: CountMajors: Count(IIF(Majors="Undecided","x",Null))
Total: Expression

In SQL text
SELECT Count(IIF(Majors="Undecided","x",Null)) as CountMajors,
....
 

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