Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

month name from the sql query

0 views
Skip to first unread message

sachin shah

unread,
Aug 16, 2007, 2:48:37 AM8/16/07
to
Hi all

i want result as month name from my query

i tried with the following query but it give result as month number
like (8)

select (month(getdate())) as expr

i want result as month name (Augest)..

give me the proper query...

from Sachin

Erland Sommarskog

unread,
Aug 16, 2007, 3:12:26 AM8/16/07
to
Look at the datename() function in Books Online.


--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

stephen

unread,
Aug 16, 2007, 4:38:28 AM8/16/07
to

Try SELECT DATENAME(MONTH,GETDATE())

0 new messages