I am trying to select students within a MYSQL database where their dates of birth are in certain months (May, June or July) here is what I think the command is:
SELECT studentid, fName, lName, dob
WHERE MONTH(dob)='5'
FROM student;
Here is an example of a records:
However I put this in the PHPmyadmin sql box and it returns an error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE MONTH(dob)='5' FROM student LIMIT 0, 30' at line 2
The field type is date. MySQL version is 5.1.41.
Any help will be appreciated.
Thanks