I Need Help Building A Query

J

JCrowe

Hi All,
I am drawing a complete blank on this query and have spent 3 hrs trying to
get past it.

Collection Situation:
1. A web page has a Poll on it that when submitted it writes to the Access
table called "survey_tbl"
2. The Poll has 3 selection to choose from and the are named A, B, C
3. The survey table has 2 fields ID and Response
4. When the user makes a selection and submits it...the table is accepts the
answer.

Note: Colleting the information into the table works if I use letters or
numbers to represent the user's answer.

Query Situation:
Once the data is collected via the input form the Response field is full of
"A", "B" & "C" 's. My thought was to run a query across the table to "Count"
but that is not working.

Needs Situation:
What I need is a method to count how many "A", "B" & "C" 's are in the
table. Once I have that I can display the results on the web page.

Thanks,
JCrowe
 
J

John Spencer (MVP)

Perhaps something like the following

SELECT QuestionNumber,
Abs(Sum([Response]="A")) as CountA,
Abs(Sum([Response]="B")) as CountB,
Abs(Sum([Response]="C")) as CountC
FROM Survey_tbl
GROUP BY QuestionNumber
 

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