dbTalk Databases Forums  

month name from the sql query

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss month name from the sql query in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sachin shah
 
Posts: n/a

Default month name from the sql query - 08-16-2007 , 01:48 AM






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


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: month name from the sql query - 08-16-2007 , 02:12 AM






sachin shah (sachin28880 (AT) gmail (DOT) com) writes:
Quote:
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...
Look at the datename() function in Books Online.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
stephen
 
Posts: n/a

Default Re: month name from the sql query - 08-16-2007 , 03:38 AM



On Aug 16, 7:48 am, sachin shah <sachin28... (AT) gmail (DOT) com> wrote:
Quote:
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
Try SELECT DATENAME(MONTH,GETDATE())



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.