timmy123


I am having a problem while converting datetime to varchar with code 106. Here is the code and result I get:

TSQL Code:
SELECT CONVERT(VARCHAR(100), GETDATE(), 106)

Result:
"26 10 2007"

My expected result:
"26 Oct 2007" or "26 October 2007"

Have you encountered this problem before Is it related to the SQL server setting Please help and thank you in advance.



Re: CONVERT DATETIME to VARCHAR with code 106 does not show long month

Madhu K Nair


When i run SELECT CONVERT(VARCHAR(100), GETDATE(), 106) i get 26 Oct 2007 only

Madhu







Re: CONVERT DATETIME to VARCHAR with code 106 does not show long month

Arnie Rowland

That may be related to your computer settings.

Check your regional datetime setting.







Re: CONVERT DATETIME to VARCHAR with code 106 does not show long month

Frank Kalis

timmy123 wrote:
I am having a problem while converting datetime to varchar with code 106. Here is the code and result I get:

TSQL Code:
SELECT CONVERT(VARCHAR(100), GETDATE(), 106)

Result:
"26 10 2007"

My expected result:
"26 Oct 2007" or "26 October 2007"

Have you encountered this problem before Is it related to the SQL server setting Please help and thank you in advance.

Take your time to read through this article: http://www.karaszi.com/SQLServer/info_datetime.asp