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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COUNTING DIFFERENT ENTRIES IN A TABLE FIELD

Status
Not open for further replies.

jascoh

Technical User
Oct 14, 2004
20
0
0
US
MS ACCESS: I have a text field in my table called 'Disposition'. I use a combo-box on a form that picks one of three answers from a separate table for this field. Either 'Positive', 'Negative' or 'Neutral'.
Now, how do I count the number of Positive responses, the number of Negative responses and the number of Neutral responses in this field? I want to show on a Report how many responses total, and what percentage were positive, negative or neutral.
PLEASE HELP.
PS: I'm not a guru so please describe what to place in each report/query or table design field if you can help.
Thanks!
-Jason
 
Here's a starting point, paste this in the SQL view and correct the table name.

SELECT Disposition, COUNT(*)
From TableName
GROUP BY Disposition

You should get:

Positive 10
Negative 15
Neutral 60

If you are putting this into a report, wait until then to do your totals and averages. If you want them in the query, then it will require a little more.

HTH

leslie


 
Leslie:
Thank you for the information, but where am I putting this information? In the table or report and how do I open the SQL View...remember, I'm good at structure and function, just not the language part of it. Just to summarize, I want to pull from my 'tblfeedback' the information in a single field. The options are 'Positive', 'Negative' and 'Neutral'. On the report, I want the following information:
X number of comments (where X is the total of the comments)
X number Positive (where X is the total of the positives)
X number Negative (")
X number Neutral (")

And then I'll do the calculations for percentages.

Does this help clarify?
I do appreciate the help (remember, you're dealing with a relative code neophyte).
-Jason
 
Leslie's solution is the record source for the report (or a subreport). You need to tell us if you want to show both detailed and summary information in your report? Do you want to show each comment and then summarize them in the report footer?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Yes. The details for each customer service comment, then the summary of negatives, positives, neutrals and their respective percentage of the total.

Something like this:

CUSTOMER FEEDBACK REPORT
..........
Comment Disposition: Positive
Note: Customer felt pricing was good

Comment Disposition: Negative
Note: Customer felt shipping was late
..........
TOTAL COMMENTS: 2
TOTAL NEGATIVE: 1 (50%)
TOTAL POSITIVE: 1 (50%)

Does this help?
 
Depending on your table structure and data, you might be able to add text boxes to your report's footer with control sources like:

=Sum(Abs([DispositionField]="Positive"))
=Sum(Abs([DispositionField]="Negative"))

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
dhookum: YOU ARE AWESOME!
Works like a charm! Why are such simple things so difficult!?
I've been looking to do this for some time.
Hey, are you aware of a book or webpage that I could go to for easy formulas like that? I think a cheat-sheet with shortcuts and stuff would be wonderful.
Thanks again. Expect to see more posts as needed!
Have a great weekend.
-Jason
 
There are lots of web resources but I would start with Jeff Conrad has lots of links on his site
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top