Here is a quick snippet to pulls the month and year from any date field in a MySQL table…
SELECT DATE_FORMAT(date_added, '%b %Y') AS sDate, COUNT(post_id) AS iCount FROM blog_posts GROUP BY sDate ORDER BY sDate DESC
sDate | iCount |
---|---|
Jan 2012 | 4 |
Dec 2011 | 16 |
Nov 2011 | 0 |
Oct 2011 | 12 |
Mostly for my reference, but hope it helps someone else 😉
Thank you very very much!!