This is my Presence table that tracks the students' attendence and absence
![Name: 2-49-10.png
Views: 22
Size: 6.9 KB]()
I can display the list of attendees on a grid easily
For this I use:
However when I want to display the list of attendees with the number of sessions attended for each pupil, I can only get one record displayed on the grid.
I even used
but doesn't seem to work
thank you
I can display the list of attendees on a grid easily
For this I use:
Code:
StrSql = "Select Fname, Lname , " & _
" BirthDate, classe_name, subject from Student_tbl" & _
" left join Presence_tbl on Student_tbl.ID = Presence_tbl .PID " & _
" left join subject_tbl on Presence_tbl.subj_id = subject.id " & _
" left join class_tbl on Presence_tbl.class_id = class_tbl.ID " & _
" Where Presence = 1 and date_id = " & Lbl_Date(1).Caption
Set Rs = Cnn.OpenRecordset(StrSql)
Code:
StrSql = "Select Fname, Lname , " & _
" BirthDate, classe_name, subject, sum (presence) as presences from Student_tbl" & _
" left join Presence_tbl on Student_tbl.ID = Presence_tbl .PID " & _
" left join subject_tbl on Presence_tbl.subj_id = subject.id " & _
" left join class_tbl on Presence_tbl .class_id = class_tbl.ID " & _
" Where Presence = 1 and date_id = " & Lbl_Date(1).Caption & " GROUP BY Fname"
Set Rs = Cnn.OpenRecordset(StrSql)
Code:
count (presence) as presences
thank you