I am doing some reports and I want to get all dates in specific month, for example January 2014, and when I do this \'SQL\':
SELECT datesInMonth WHERE month
You can use the datetime function in MySQL. In particular, MONTH() and YEAR(). If you pass a date into those functions, it'll return the month or year. For example:
WHERE MONTH(my_date) = 2 and YEAR(my_date) = 2014
If you want to get all of the dates in a month, you can do something like this:
SELECT my_date FROM my_table
WHERE MONTH(my_date) = 2 and YEAR(my_date) = 2014