Question
cfquery and ListFind()
I have a query 'qryTest1' that queries question and answer
values from a table. the values displayed are
ex: Q1 A1
Q2 A2
Q3 A3
Q1 A4
Q1 A5
Now, I have other query 'qryTest2' that queries another table to find answers that are valid for Q1
What i need to do is to display from qryTest1 is only those answers that are valid for Q1
What i m doing is
<cfoutput query = qryTest1>
<cfif question_number EQ Q1 AND ListFind(qryTest2.answer_values, answers)
display the question and answers
<cfelse>
do not display that record
</cfif>
What happens is that it displays the question and answer value for only first Q1, but the remaining two Q1's , even if they are valid, it doesn't display the values.
What is missing here
ex: Q1 A1
Q2 A2
Q3 A3
Q1 A4
Q1 A5
Now, I have other query 'qryTest2' that queries another table to find answers that are valid for Q1
What i need to do is to display from qryTest1 is only those answers that are valid for Q1
What i m doing is
<cfoutput query = qryTest1>
<cfif question_number EQ Q1 AND ListFind(qryTest2.answer_values, answers)
display the question and answers
<cfelse>
do not display that record
</cfif>
What happens is that it displays the question and answer value for only first Q1, but the remaining two Q1's , even if they are valid, it doesn't display the values.
What is missing here