I am using the Google Charts API to create some custom charts, and that is working well but now I have an odd SQL question.
I am creating a custom chart which compares Leads Generated this year vs Leads generated the same time the previous year.
The query below works well BUT how can I sort the months in their correct natural order?
SELECT
YEAR(date_entered) as year,
MONTHNAME(date_entered) as MONTH,
count(id) as total
FROM leads
WHERE
YEAR(date_entered) = YEAR(NOW() - INTERVAL 1 YEAR) OR
YEAR(date_entered) = YEAR(NOW())