I am using a custom SQL report to gather information on course completion for administrators. I need to call a custom profile field I created that was named School or Site. It has a shortname of "site". How can I add this selection to the SQL I am using. The query I am using is listed below:
SELECT u.firstname AS First, u. lastname AS Last, c.fullname AS Course,
DATE_FORMAT(FROM_UNIXTIME(p.timecompleted
),'%Y-%m-%d')
AS completed
FROM prefix_course_completions AS p
JOIN prefix_course AS c ON p.course = c.id
JOIN prefix_user AS u ON p.userid = u.id
WHERE c.enablecompletion = 1
ORDER BY c.fullname, u.lastname