I have a bar chart as below
the horizontal axis has months and years,is there any way i can sort the months order? like January,february,March...
thanks in advance
I have a bar chart as below
the horizontal axis has months and years,is there any way i can sort the months order? like January,february,March...
thanks in advance
Sort by the month number but display the month name:
SELECT Month(DateField) AS [Month], DateName(Month, DateField) AS [MonthName], OtherFields
FROM MyTable
ORDER BY Month(DateField)
you can use this DATEPART(m, table.date) AS MonthNumber, and you can sort it using this field, and add more sort field on the top for years using this DATEPART(yyyy, table.date) AS AccountYear.