Hello readers
At the school where I work, we would like to represent individual student attendance as a pie chart (which is a sub-report on their academic report.)
The problem is that attendance is extremely eratic and we often have students arriving/enrolling many days into the term.
For various reasons, we are not able to backdate their absense prior to the first arrival day (each term) in the system.
So, based on the info in the following tables, I am able to create a pie chart showing ATTENDANCE and ABSENCE from the first arrived date, but how do I include the days prior to arrival in the chart.
eg Term starts 27/01/2011 and ends 07/04/2011
Excluding week-ends and public holidays, there are 52 school days in the term.
But the student only arrives on 03/03/2011, so will attend for a maximum of 25 schools days this term.
Actually, he has run away a few times, so attendance shows as
Attended : 16 days
Absent : 9 days
But I want to be able to show that he arrives late and thus missed 27 days prior to arrival.
The database does have:
1. A calendar table (EBIZDW11_ATTCAL) identifying school days.
2. The Student list (EBIZDW11_STUDENT)
3. Actual attendance (EBIZDW11_ATTHST)
The following is the query that calculated attendance.
SELECT "EBIZDW11_STUDENT"."CSTUDID", "EBIZDW11_ATTHST"."ATDATE", "EBIZDW11_ATTHST"."ATCODE", "EBIZDW11_ATTHST"."ATTYPE", "EBIZDW11_STUDENT"."SURNAME", "EBIZDW11_STUDENT"."CNAME", "EBIZDW11_ATTHST"."ATYEAR", "EBIZDW11_ATTCAL"."TERM", "EBIZDW11_ATTCAL"."ATSCHDAY"
FROM ("QUAD"."dbo"."EBIZDW11_ATTHST" "EBIZDW11_ATTHST" INNER JOIN "QUAD"."dbo"."EBIZDW11_STUDENT" "EBIZDW11_STUDENT" ON ((("EBIZDW11_ATTHST"."SCHREGN"="EBIZDW11_STUDENT"."SCHREGN") AND ("EBIZDW11_ATTHST"."SCHCDE"="EBIZDW11_STUDENT"."SCHCDE")) AND ("EBIZDW11_ATTHST"."CAMPUS"="EBIZDW11_STUDENT"."CAMPUS")) AND ("EBIZDW11_ATTHST"."STUDID"="EBIZDW11_STUDENT"."CSTUDID")) INNER JOIN "QUAD"."dbo"."EBIZDW11_ATTCAL" "EBIZDW11_ATTCAL" ON ("EBIZDW11_ATTHST"."ATYEAR"="EBIZDW11_ATTCAL"."ATYEAR") AND ("EBIZDW11_ATTHST"."ATDATE"="EBIZDW11_ATTCAL"."ATCALDAY")
ORDER BY "EBIZDW11_STUDENT"."CSTUDID", "EBIZDW11_ATTHST"."ATDATE"
Hope this all makes sense?