BrighteyesDesign
asked on
MySQL won't show results as DESC?
I'm simply trying to display the query below in date DESC so 2012 is at the top but for some reason it's displaying ASC?
I have used the same code on another pretty much identical database fine. Any ideas why this isn't working?
Screen-shot-2012-04-05-at-13.22..png
I have used the same code on another pretty much identical database fine. Any ideas why this isn't working?
SELECT id, YEAR(`eventdate`) AS 'year', MONTH(`eventdate`) AS 'month', COUNT(`id`) AS 'count' FROM `news` GROUP BY YEAR(`eventdate`), MONTH(`eventdate`) ORDER BY YEAR('eventdate') DESC, MONTH('eventdate') DESC
Screen-shot-2012-04-05-at-13.18..pngScreen-shot-2012-04-05-at-13.22..png
ASKER
Still the same? very strange.
Screen-shot-2012-04-05-at-14.01..png
Screen-shot-2012-04-05-at-14.01..png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a million, works perfectly now
SELECT YEAR(`eventdate`) AS 'year', MONTH(`eventdate`) AS 'month' FROM `news` GROUP BY YEAR(`eventdate`), MONTH(`eventdate`) ORDER BY YEAR('eventdate') DESC, MONTH('eventdate') DESC