Hi Mark,
I think Randy meant to check this part of the code,
CASE WHEN i.userid IS NOT NULL # Should test to see whether the student has a certificate or not
THEN 'Yes'
ELSE "No"
END
AS "Has certificate"
It is going to be always yes because the userid will not be null, you need to change this condition. I think the condition should be related to customcert or customcert_issue, you can try this
CASE WHEN i.userid = u.id # because the customcert_issues is the table which Stores each issue of a customcert
THEN 'Yes'
ELSE "No"
END
AS "Has certificate"
I hope that will help.
Regards
Mo
I think Randy meant to check this part of the code,
CASE WHEN i.userid IS NOT NULL # Should test to see whether the student has a certificate or not
THEN 'Yes'
ELSE "No"
END
AS "Has certificate"
It is going to be always yes because the userid will not be null, you need to change this condition. I think the condition should be related to customcert or customcert_issue, you can try this
CASE WHEN i.userid = u.id # because the customcert_issues is the table which Stores each issue of a customcert
THEN 'Yes'
ELSE "No"
END
AS "Has certificate"
I hope that will help.
Regards
Mo