I was having trouble performing queries using unix timestamps (which is my preferred method - just getting that out of the way) so I felt like going old school and using the datetime field type in MySQL for this project.
My problem is that I want to query MySQL to return a specific date (month / year).
Here's what I have:
:: Example data
2008-04-12 23:27:21
2008-04-13 00:12:10
2008-03-12 00:49:28
2007-12-25 13:14:15
:: Searching for
04-2008
It should return record 1 & record 2.
I could post my query but I already know I'm way off so I'm not going to embarass myself further 🙂
How would one go about doing this? I tried returning something with DATE_FORMAT (created_on, '%M %Y) and even a few variations of the DATE function inside of MySQL but it's returning nothing as I'm obviously missing something here.
Suggestions?