shahgols
SSCrazy Eights
Points: 9874
More actions
June 22, 2005 at 6:47 pm
#87919
Hello everyone, when I run this statement:
select convert(char, '2004-12-22 11:36:02.000', 101)
I expect to get "12/22/2004", but I get "2004-12-22 11:36:02.000". What am I doing wrong?
Thanks in advance.
sushila
SSC-Dedicated
Points: 35293
June 22, 2005 at 8:26 pm
#567748
You're passing only a string value to convert - you need to first change it to datetime type...try this:
select convert(char(10), cast('2004-12-22 11:36:02.000' as datetime), 101)
**ASCII stupid question, get a stupid ANSI !!!**
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply