SELECT dbo_grades.gradename,dbo_students.studentname, dbo_days.Day, dbo_absents.absent
FROM dbo_grades INNER JOIN (dbo_students INNER JOIN (dbo_days INNER JOIN dbo_absents ON dbo_days.id_day = dbo_absents.am_day) ON dbo_students.id_students = dbo_absents.studentid) ON dbo_grades.id = dbo_students.gradeid
UNION ALL
SELECT dbo_grades.gradename,dbo_students.studentname, dbo_days.Day,dbo_lates.late
FROM dbo_grades INNER JOIN (dbo_students INNER JOIN (dbo_days INNER JOIN dbo_lates ON dbo_days.id_day = dbo_lates.am_day) ON dbo_students.id_students = dbo_lates.studentid) ON dbo_grades.id = dbo_students.gradeid
UNION ALL SELECT dbo_grades.gradename,dbo_students.studentname, dbo_days.Day,dbo_medical.medical
FROM dbo_grades INNER JOIN (dbo_students INNER JOIN (dbo_days INNER JOIN dbo_medical ON dbo_days.id_day = dbo_medical.am_days) ON dbo_students.id_students = dbo_medical.studentid) ON dbo_grades.id = dbo_students.gradeid;