Avatar of johnnyg123
johnnyg123
Flag 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
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
Anthony Perkins

8/22/2022 - Mon
Kent Dyer

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
Steve Wales

THIS SOLUTION 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
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Haver Ramirez

take a look, contains all conversions

http://www.sqlusa.com/bestpractices/datetimeconversion/
Alpesh Patel

select Format (sysdatetime(), 'D', 'en-US')
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ValentinoV

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.
Anthony Perkins

this is not the first time
And unfortunately it will not be the last, despite repeated reminder over the years.