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.
Author |
Topic |
jhnegrao
Yak Posting Veteran
81 Posts |
Posted - 2007-10-19 : 11:07:47
|
Hello, I've been trying to converting a specific string to a Datetime field, but sometimes I'm not having success.I've traced this and I got that the following error:Server: Msg 242, Level 16, State 3, Line 1The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.I saw that this error happen when I'm converting a string like that2007-13-10 00:00:32.570So, when I need to convert a time with 00:00 this error happen.Anybody knows what's going on?Have a nice weekend |
|
Zoroaster
Aged Yak Warrior
702 Posts |
Posted - 2007-10-19 : 11:18:55
|
Because there is no 13th month, and where you have 13 it is interpreting as a month field not a day. Future guru in the making. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 03:26:56
|
What is the format of the string?TrySelect convert(datetime,stringcol) from tablewhere isdate(stringcol)=1MadhivananFailing to plan is Planning to fail |
 |
|
jhnegrao
Yak Posting Veteran
81 Posts |
Posted - 2007-10-22 : 07:56:18
|
Hello, What Zoroaster sad is correct and I solved the problem.Thanks. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-22 : 08:19:11
|
quote: Originally posted by jhnegrao Hello, What Zoroaster sad is correct and I solved the problem.Thanks.
How did you solve?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|