I have a bunch of films in a table with release dates formatted like: November 12, 2011
I want to grab all the films that have been released to theaters in the past three weeks. The release date column is ‘release’.
I tried this
"SELECT title, keyw, views, release
FROM films
WHERE STR_TO_DATE(release, '%M %e, %Y') <= DATE_SUB(CURDATE(),INTERVAL 21 DAY)
ORDER BY views DESC
LIMIT 8
I’m getting a mysql error claiming it’s not geting this. Something I’m overlooking?
SELECT title, fkeyw, views, release
FROM films
WHERE STR_TO_DATE(release, '%M %e, %Y') >= DATE_SUB(CURDATE(),INTERVAL 21 DAY)
ORDER BY views DESC
LIMIT 8
And still getting error: “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 ‘release FROM films WHERE STR_TO_DATE(release, ‘%M %e, %Y’) >= DATE_SUB(CURDATE()’ at line 1”