Small fix to query in update_attendance.cpp