[dba-SQLServer]Convert int month to char month

James Barash jbarash at bellatlantic.net
Fri Apr 25 11:04:12 CDT 2003


Ken,
Try something like this:

left(convert(datetime, mydate, 107),3)

This works in SQL2000, I don't know of convert exists in SQL7.

James Barash

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stoker,
Kenneth E
Sent: Friday, April 25, 2003 11:27 AM
To: dba-SQLServer (E-mail)
Subject: [dba-SQLServer]Convert int month to char month


Does anyone know of a way to convert the return value of month([mydate])
from an integer to its equivalent char value?

	1	JAN
	2	FEB
	3	MAR
	.....

Thank you for your help.

Ken Stoker
Technology Commercialization
Information Systems Administrator
PH: (509) 375-3758
FAX: (509) 375-6731
E-mail:  Kenneth.Stoker at pnl.gov 


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



More information about the dba-SQLServer mailing list