Thursday, March 8, 2012

datetime error

while executing the following statement:
select convert(datetime,'Nov 31, 2002 10:05pm')
got the following error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

the datetime set is mdy
is there any way to make this work though this is not according to the iso standarts.

regards,
harsh.Does november contain 31 days ... hmm .. something is very wrong with your code
this works :-
select convert(datetime,'Nov 30, 2002 10:41PM',107)|||Originally posted by Enigma
Does november contain 31 days ... hmm .. something is very wrong with your code
this works :-
select convert(datetime,'Nov 30, 2002 10:41PM',107)

:D :D :D
how foolish of me!!
actually this was the input to a proc and the parameters were provided by the programmers, so i just tried to check with the same.
nways thnxs.
regards,
harsh.

No comments:

Post a Comment