SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 DateTime format when casting to varchar
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GoDaddy
Yak Posting Veteran

64 Posts

Posted - 04/20/2009 :  16:58:36  Show Profile  Reply with Quote
How do I change the format of datetime when casting to varchar ?

It returns like Feb 9 2009 12:00:00 AM ..... I want mm/dd/yyyy only ..

mfemenel
Professor Frink

USA
1421 Posts

Posted - 04/20/2009 :  17:01:28  Show Profile  Visit mfemenel's Homepage  Reply with Quote
Check out convert in books online it has all the info you'll need.

Mike
"oh, that monkey is going to pay"
Go to Top of Page

GoDaddy
Yak Posting Veteran

64 Posts

Posted - 04/20/2009 :  17:07:23  Show Profile  Reply with Quote
cool found the Convert(varchar(10), date, 101)

I suppose that 101 is the format ? where is this store ?
Go to Top of Page

bklr
Flowing Fount of Yak Knowledge

India
1693 Posts

Posted - 04/21/2009 :  00:00:32  Show Profile  Reply with Quote
check these links for conversion of dates
http://www.sql-server-helper.com/tips/date-formats.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80563

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000