Empty result when using mySQL WEEK() to find dates in current week

Monday, July 7, 2014

We are using the following statement to select dates of birth which occur in the current week:



SELECT * FROM tbl_user WHERE WEEK(dob,1) = WEEK(CURDATE(),1) ORDER BY id DESC


Our 'dob' column has the type DATE and contains 1 record where dob is 1972-07-09. However, when we run our query (today is 2014-07-07) we get an empty result.


Any ideas why?? Does WEEK() only work on columns with type DATETIME?


Thanks in advance for an help!







http://ift.tt/1smA9zd