How to Get Data Order by Month Name from SQL

 To Gate Data Order by Month Name You can Use the 'DATENAME' Function for extract Month Name from the Date Column and then use order by clause to sort the result by the month name. as per below example.


Select column1, column2, DateName(MM, Date_Column) as MonthName 

from Table1

order by month(Date_Column)


In this example replace 'column1' and 'column2' with your actual column name and 'Date_Column' with actual column which has date value. Replace Table1 with actual Table.

'DateName'  function is use to extract Month Name from the date_column.

Order By clause is use to sort the data ascending and descending order. In above example 'Month' function used for the sorting data by month name like January, February, March. 

Popular posts from this blog

How to Reset Terminal license on Windows 2008, 2008 R2 and 2012

How to remove a static IP configuration for an absent network adapter or uninstall hidden network adapter