Mr Chris Posted August 28, 2008 Share Posted August 28, 2008 Hi All, I have a query which outputs a count of months SELECT MONTH(published) as the_month, COUNT(*) AS total FROM cfm_stories WHERE YEAR(published) = YEAR(NOW()) GROUP BY MONTH(published) LIMIT 1,6 But how do I force a column to be created with the month name. IE at the moment Febuary's value for the_month is 2, March is 3 etc... Thanks Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 28, 2008 Share Posted August 28, 2008 See the mysql DATE_FORMAT() function. A %M format parameter would give the month name. Quote Link to comment Share on other sites More sharing options...
Barand Posted August 30, 2008 Share Posted August 30, 2008 as will SELECT MONTHNAME(published) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.