Woodburn2006 Posted November 20, 2007 Share Posted November 20, 2007 i have a load of news items stored in a db. the time and date is in a field set as DATETIME how would i select just the news from September 2007? Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 20, 2007 Share Posted November 20, 2007 Try something like this: SELECT * FROM my_table WHERE MONTH(date_col) = 9 AND YEAR(date_col) = 2007 You could also do something like this: SELECT * FROM my_table WHERE date_col BETWEEN '2007-11-01' AND '2007-11-30' 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.