Gossamer Forum
Home : General : Databases and SQL :

newbie Access help!

Quote Reply
newbie Access help!
I am writing an evaluation program.... the answers to the evaluation questions are saved as 2 to -2, and there are 13 questions called Opt01 to Opt13.

I need to write a query that will get the COUNT of how many 2's (or Strongly Agrees...)1's..0's...etc... that each question recieved so that i can plug that into my VB front end. Im using ADO in my VB app....

I would like to write it like this:

SELECT COUNT(Opt01) AS Opt01SA, COUNT(Opt02) AS Opt02SA.....etc

FROM EvalDetails

WHERE ???? = 2 ???

The other way would be to write 5 x 13 COUNT queries... and i can't make a script in Access that i could populate the VB ADODB.Recordset with...... or else throw 5 x 13 queries into a macro... also a pain to extract the data from....

Any help on a simpler way to get this data out... in a count.... would be greatly appreciated....

Thank You
Quote Reply
Re: [gluck] newbie Access help! In reply to
use the GROUP BY function along with SUM function of the column you want to get the count.
Buh Bye!