...
A student is deemed to be ‘here' (i.e. ‘in schoolschool’) if their course dates are across the period dates.
...
Additionally, please exclude any students from the list, who may be on holiday, i.e. every day, across the whole Period Start/End. periodStartDate, periodEndDate.
If the student is ‘in school’ on any day during the period and they are also ‘on holiday’ for some, but not all, of the periodStartDate, periodEndDate then they are deemed to be ‘in school’
Holidays are stored in another object Holidays__c with fields, Student_Id, Holiday_Start_Date__c and Holiday_End_Date__c, Status__c.
...