Hi Melanie,
Sorry for taking a while to respond. Thanks a lot for the help. I turned on debugging mode and you were right about the RIGHT join on course_info_data statement. It was getting hung up on that. When I removed that line in went a bit further and got hung up on WHERE ra.userid=u.id.
When I have time I will see if I can troubleshoot that. It might be to do with our version of SQL or perhaps even how we handle user IDs. We use LDAP authentification and to be honest we don't have it set up quite right.
Thanks a lot of the SQL Query though. I am sure with a bit of tweaking I can get it to work. I might have to go to the library first though and read a bit about SQL : )
Cheers,
Chris