I think my brain has started to bleed. I have mdl_enroll (this is the table that id's methods for each course). I get that one. I've got mdl_user_enrolment (where it shows a user has been enrolled) but I see a whole lot of enrolment that has been removed, canceled, deleted, whatever but it doesn't ever seem to show me the enrolment is no longer valid. Maybe someone got enroled by accident and was unenroled...
Basically, I'm creating business intelligence reports (again...is it just me, or does anyone else hear the word oxymoron every time someone says business intelligence?). My current ones do fine but they pull all enrolments, even if the user isn't enroled any longer and I can't quite figure out how to stop that. I keep trying to link in context with roles and role assignments and then it explodes. Maybe I'm not doing it right.