on the internet i find only very few info about count in ms access there is query string
"SELECT students.Student FROM specialty INNER JOIN (groups INNER JOIN
((mark INNER JOIN students ON mark.idstudent = students.IDstudent)
INNER JOIN miss ON students.IDstudent = miss.IDstudent)
ON(groups.IDgroup = students.IDgroup) AND(groups.IDgroup = miss.IDgroup))
ON specialty.IDspecialty = groups.IDspecialty WHERE specialty.Name =
'" DateFind.otdel "' GROUP BY students.Student"
what does it - it selects all students with misses, 2, non-admission to lessons. And i need to count amount of students with that parameters.
and i tried to do something with counting via adding
SELECT COUNT(student) FROM students.student WHERE
and it does nothing. Idk how to work with count so help pls, i rly checked on internet and there was only simple queries like count by 1 field without any innerjoins and etc.
CodePudding user response:
If your posted query works, then wrap this as a subquery:
"Select Count(*) From (SELECT students.Student FROM specialty INNER JOIN (groups INNER JOIN
((mark INNER JOIN students ON mark.idstudent = students.IDstudent)
INNER JOIN miss ON students.IDstudent = miss.IDstudent)
ON (groups.IDgroup = students.IDgroup) AND (groups.IDgroup = miss.IDgroup))
ON specialty.IDspecialty = groups.IDspecialty WHERE specialty.Name =
'" DateFind.otdel "' GROUP BY students.Student) As T"