I hope that someone can help with this one.
I am working on a survey program that needs to keep track of the members who have answered which surveys.
Table 1 has
surveyid <PK>
question
answer1
answer2
answer3
answer4
Table 2 has
surveyid <PK>
userid
date_taken
answer
I need to join these tables and issue surveys to the member only where this member has not taken that particular one.
This is what I have so far
SELECT t1.SURVEYID FROM SurveyQ AS t1 LEFT JOIN SurveyA as t2 ON t1.SURVEYID = t2.SURVEYID WHERE t2.USRID != '$userid'
The only problem with this is that if I have more than one entry with this surveyid the database still kicks back a record for the taken survey.
Can anyone explain where I am going wrong here? and maybe how to get the results I am looking for?
Thanks in advance for the help
John