I am trying to count the total number of questions answered vs the total number of possible questions in a questionere I have created. I am storing the information in three tables and am running my sql in a stored proc on sql server. Here's my sql
I am pretty sure I know why this is happening but I am unsure of how to fix it ... Thank you in advance.
Code:
select count(a.wfa_question_id) as 'number_of_questions_answered',
count(b.wfa_question_id) as 'total_number_of_questions'
from wfa_answer a,
wfa_question b,
wfa_section c
where a.wfa_header_id = @wfa_header_id
and a.wfa_question_id = b.wfa_question_id
and b.wfa_section_id = c.wfa_section_id
group by b.wfa_section_id