Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 DateTime format when casting to varchar

Author  Topic 

GoDaddy
Yak Posting Veteran

64 Posts

Posted - 2009-04-20 : 16:58:36
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

1421 Posts

Posted - 2009-04-20 : 17:01:28
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 - 2009-04-20 : 17:07:23
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
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-04-21 : 00:00:32
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
   

- Advertisement -