Reputation: 3486
If in a column I have a timestamp ie. 2010-04-01 10:40:20 How can I use SQL to select everything from October 2011?
Upvotes: 3
Views: 153
Reputation: 837886
SELECT *
FROM yourtable
WHERE col1 >= '2011-10-01' AND col1 < '2011-11-01'
Upvotes: 6
Reputation: 2431
try this:
SELECT * FROM table WHERE MONTHNAME(filed_date) = 'October' AND YEAR(field_date)='2011'
Upvotes: 2