How can I make a query that conditions a Month - Year only selection? Like, Where the range is January 2013 - December 2014?
I have a "date" column in my table.
I usually do a date range like WHERE date >= ? AND date <= ? which is from date to date. I only want to select the Month and Year only, without the day.
Now I want to do WHERE date >= (January 2013) AND date date <= (December 2014).
Is it possible?
SELECT * FROM TABLE_NAME
WHERE DATE_FORMAT(date, "%Y-%m") BETWEEN '2013-01' AND '2014-12';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With