SELECT p.Gender,COUNT(p.Gender) AS 'ValueG' from tbpersonal AS p, tbhcheck AS c WHERE c.StudentID = p.StudentID
AND c.CaseDate >= 2017-10-01 AND c.CaseDate <= 2017-10-30 GROUP BY p.Gender
ขาด single quote ครอบ วันที่ แต่ควรใช้ between แทนนะครับ Code (SQL)
SELECT
p.Gender, COUNT(p.Gender) AS 'ValueG'
from tbpersonal AS p, tbhcheck AS c
WHERE c.StudentID = p.StudentID
AND (c.CaseDate between '2017-10-01' AND '2017-10-30')
GROUP BY p.Gender