Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

smalldatetime convert to varchar

Status
Not open for further replies.

GrocExp

Programmer
Jul 13, 2001
2
US
Why when I use this statement...
SELECT CONVERT(varchar,'Jun 01 2001',101)
...the result is...Jun 01 2001

When I use this statement...
SELECT CONVERT(varchar,'06/01/2001',101)
...the result is...06/01/2001

The style format for 101 is mm/dd/yy why does SQL ignore my preferred format defined by 101?

The format Jun 01 2001 is number 107. Does this have anything to do with the definition of time on the SQL Server?

:-I
 
I'm replying to my own message. I had a variable defined wrong. I had to change that declaration from varchar to smalldatetime.
LOL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top