Thank you for your reply. Still, I don’t see any indication showing the records that don’t have any Absence in the Attendance column. The idea is to show ALL records, except that those records that have an “Absent” characteristic need to have the percentage calculation performed on them. The rest of the records would need to show a 100 % attendance.
I have been Googling around for solutions and, as usual, I've found some good hints at W3schools.com that tend to reinforce a previous idea about this. I doubt the syntax I’ve written below is correct, but what I would ideally like to do with it is to SELECT all records from oxadmain and perform the COUNT() functions and Math calculations only WHEN the records contain an Absent instance in the Attendance field, and store the results in the variable Percentage. ELSE enter the value of “100” as Percentage.
I hope my idea makes sense to you.
WHEN attendance = Absent THEN SELECT Count(*) AS ClassDays, (SELECT Count(*) FROM oxadmain WHERE studentID = nestidparam AND Absent = 1) AS ClassAbsent, ROUND ((ClassAbsent/ClassDays)*100, 2) AS Percentage
Percentage = “100”
ORDER BY name ASC
Would something like the above work?
NOTE: It isn't clear to me whether the first COUNT(*) is counting ALL the records in the table or only the number of records per student. The COUNT needed would be that of records (total class-days) per student.
Any suggestions would be highly appreciated.
Thank you for your attention