Search This Blog

Wednesday, 30 March 2011

Date Format and Month Name in SQL Server

 You can Convert Month Number to Month Name in SQL Server in the following way.
 just copy past this query and get the result.

SELECT DATENAME(month, getdate()) AS 'Month Name'

The Screen Shot is also attached. 


Month name in SQL Server 2005 and Date Format.

The  screen shot also describing the different date format that you can use.


SELECT CONVERT(VARCHAR(12),GETDATE(),106)'Today Date'

The above query show the following result.
31 Mar 2011