Groups | Blog | Home
all groups > sql server new users > february 2006 >

sql server new users : convert date to string


Senthilkumar
2/1/2006 12:00:00 AM
Hi,

I am designing a query in MS Sql in which i want to transform the Date value
to Mar' 06. How can i do this. Based on an earlier question, i tried using
the
convert() function w/o any luck.

Help will be very much appreciated

Senthilkumar

Raymond D'Anjou
2/1/2006 12:00:00 AM
[quoted text, click to view]

Do this client side.
Regional settings may give different results in SQL.

set language english
select left(convert(varchar(100), getdate(), 107), 6)
---returns Feb 01

set language french
select left(convert(varchar(100), getdate(), 107), 6)
---returns févr 0 (because of the 4 letter French abbreviation, the date is
cut off)

AddThis Social Bookmark Button