We are trying to pull data out of the activities table so we can exclude students that are enrolled in a specific activity from pulling into one of our external systems. Is this possible? I haven't found a way to separate out that data.
how does the date get to your external system? Is it a SQL export? Using SQL, you should be able to exclude them.
Thanks for the response. We are working on a SQL export, but having trouble finding the field to exclude them. when we try Activities.studentid or activities.studentdcid we get errors.
Can you share the query with me? I'll be happy to look at it. Which activity are you trying to exclude?
You could use something like this:
SELECT s.lastfirst as student, s.student_number
FROM students s
WHERE s.dcid NOT IN (SELECT a.studentsdcid FROM activities a INNER JOIN students s on s.dcid = a.studentsdcid WHERE a.activities_football = '1' and s.enroll_status = 0)
AND s.enroll_status = 0
AND s.schoolid = ~(curschoolid)
This script should give you all students that are not playing football.
One other thing, the above script may not give you results. Since each school can code their activities differently, you will need to know wha the student field name is, and adjust it in the query.