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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

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

Professor Frink

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.

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

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

Flowing Fount of Yak Knowledge

1693 Posts

Posted - 04/21/2009 :  00:00:32  Show Profile  Reply with Quote
check these links for conversion of dates

Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000