coupe-r Posted October 26, 2010 Share Posted October 26, 2010 Hi everyone, In the DB, I store dates as date("Y-m-d H:i:s") so it reads "2010-10-25 23:16:06" In a SQL query, I want to query all 2010 dates. I tried, WHERE date_created = '".date("Y")."', but no luck. What goes where date("Y") is? Thanks Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 26, 2010 Share Posted October 26, 2010 Do it in the query with MySQL's DATE_FORMAT() function. Quote Link to comment Share on other sites More sharing options...
coupe-r Posted October 26, 2010 Author Share Posted October 26, 2010 Works Perfect, thank you very much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.