I'm writing a report for a college to compare the numbers of students enrolled on a course this year with the numbers last year. Courses can be 1, 2 or 3 years in length. So far, I am calculating the enrolments on a particular year of a course as follows:
1. A student is in year 1 of a course this year if:
* Course Start date is between 1/8/AY and 31/7/(AY+1)
* Student Enrolment on the course ends after 1/MM/AY
2. A student is in year 2 of a course this year if:
* Course Start date is between 1/8/(AY-1) and 31/7/AY
* Student Enrolment > 1/MM/AY
3. on year 1 last year if:
* Course Start between 1/8/(AY-1) and 31/7/AY
* Student Enrolment > 1/MM/(AY-1)
4. on year 2 last year if:
* Course Start between 1/8/(AY-2) and 31/7/(AY-1)
* Student Enrolment > 1/MM/(AY-1)
and similarly for year 3 of the course, if applicable.
In the above, AY is the current Academic Year (which is calculated in the database), and MM is a month number entered as a parameter for a census date, so that the numbers of enrolments can be checked for any time of the year.
The problem with the above method, is that if a student enrols straight onto year 2 of a course this year (for example), he/she is still counted as on year 1 last year, because the year is worked out from the module start date. I need a way of avoiding counting the student on year 1.
Each module (course) has a specific start date (usually 1/8) and a specific end date (usually 31/7). The student has enrolment dates on the module. The enrolment start date is ALWAYS later than the module start date, and the enrolment end date can be any time during the lifetime of the module).
To give an example of the problem I'm having might make it easier to understand. Let's say I have a module which starts on 1/8/99 and ends on 31/7/01. If a student enrols onto the module on, say, 14/9/99 and is still on the course after 1/8/00, then he is on year 1 last year and year 2 this year (see points 2 and 3 above). If, however, a student enrols on the same course on 14/9/00, i.e. straight into year 2, because the student enrolment end date is still after 1/8/99, he fits criteria 2 and 3 again, and so is counted on both year 1 last year and year 2 this year.
Any tips or suggestions would be greatly appreciated.
Gareth
1. A student is in year 1 of a course this year if:
* Course Start date is between 1/8/AY and 31/7/(AY+1)
* Student Enrolment on the course ends after 1/MM/AY
2. A student is in year 2 of a course this year if:
* Course Start date is between 1/8/(AY-1) and 31/7/AY
* Student Enrolment > 1/MM/AY
3. on year 1 last year if:
* Course Start between 1/8/(AY-1) and 31/7/AY
* Student Enrolment > 1/MM/(AY-1)
4. on year 2 last year if:
* Course Start between 1/8/(AY-2) and 31/7/(AY-1)
* Student Enrolment > 1/MM/(AY-1)
and similarly for year 3 of the course, if applicable.
In the above, AY is the current Academic Year (which is calculated in the database), and MM is a month number entered as a parameter for a census date, so that the numbers of enrolments can be checked for any time of the year.
The problem with the above method, is that if a student enrols straight onto year 2 of a course this year (for example), he/she is still counted as on year 1 last year, because the year is worked out from the module start date. I need a way of avoiding counting the student on year 1.
Each module (course) has a specific start date (usually 1/8) and a specific end date (usually 31/7). The student has enrolment dates on the module. The enrolment start date is ALWAYS later than the module start date, and the enrolment end date can be any time during the lifetime of the module).
To give an example of the problem I'm having might make it easier to understand. Let's say I have a module which starts on 1/8/99 and ends on 31/7/01. If a student enrols onto the module on, say, 14/9/99 and is still on the course after 1/8/00, then he is on year 1 last year and year 2 this year (see points 2 and 3 above). If, however, a student enrols on the same course on 14/9/00, i.e. straight into year 2, because the student enrolment end date is still after 1/8/99, he fits criteria 2 and 3 again, and so is counted on both year 1 last year and year 2 this year.
Any tips or suggestions would be greatly appreciated.
Gareth