Link to home
Avatar of johnnyg123
johnnyg123Flag for United States of America

asked on

Converting Dates with SQL

I know I've done this before but can't remember

How do I convert a date so it comes out in long day, month year format in t-sql

for example

1/17/2013

to

Monday, January 7, 2013
Avatar of Kent Dyer
Kent Dyer
Flag of United States of America image

CAST / CONVERT in BOL should cover this..

http://msdn.microsoft.com/en-us/library/ms187928%28v=sql.105%29.aspx

HTH,

Kent
ASKER CERTIFIED SOLUTION
Avatar of Steve Wales
Steve Wales
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Haver Ramirez
Haver Ramirez

take a look, contains all conversions

http://www.sqlusa.com/bestpractices/datetimeconversion/
select Format (sysdatetime(), 'D', 'en-US')
PatelAlpesh, the FORMAT function only exists in SQL Server 2012.  The question clearly states that the asker uses SQL Server 2008.  Please read the full question and other posts before deciding to post yourself. (this is not the first time)

The answer by sjwales achieves what has been asked.
this is not the first time
And unfortunately it will not be the last, despite repeated reminder over the years.