To make more sense, c_student_id is pulled from user_id originally, so when it is a match in
Code:
WHERE #__quiz_r_student_quiz.c_student_id = #__comprofiler.user_id);
it is updated. The c_passed is the only field option I have to choose from as this is the results given by the quiz, either 0 or 1. I just wanted to add this to the field cb_trainingpass that is already used to show yes or no, if quiz completed and passed.
The ORDER BY looks to be an option if there is a way to select latest date, as there is a date column. Let me look more into that and some of the other things you have mentioned.
UPDATE #__comprofiler
SET cb_trainingpass = ( SELECT if(c_passed=1,'yes','no')
FROM #__quiz_r_student_quiz
WHERE #__quiz_r_student_quiz.c_student_id = #__comprofiler.user_id
order by #__quiz_r_student_quiz.YOURDATEFIELD desc)
WHERE EXISTS
( SELECT c_passed
FROM #__quiz_r_student_quiz
WHERE #__quiz_r_student_quiz.c_student_id = #__comprofiler.user_id);