MySQL DATE_FORMAT comparison to CURDATE() query...
- by Crazy Serb
Hey guys, I am just trying to pull all the records from my database who have a rec_date (varchar) stored as m/d/Y and are expired (as in, less than curdate()), and this call isn't giving me what I want:
SELECT member_id, status, DATE_FORMAT(STR_TO_DATE(rec_date, '%m/%d/%Y'), '%Y-%m-%d') AS rec
FROM members WHERE rec_date CURDATE() AND status = '1'
I'm obviously doing something wrong, so can you help?
Thanks.