日期:2014-05-17  浏览次数:20438 次

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime valu
时间的格式不正确。
YY-MM-DD
SQL code
select HelpDateTime  from Shop_Help where  HelpDateTime < '2009-06-22' 

假如写成'2009-06-22' 就会提示The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.的错误
而要是'2009-06-12' 就没事。也就是说DAY这。要是少于13就OK。它默认的是十二月份(1-12)只要出现13天了错误就出现了!!!


怎么解决呀!!

------解决方案--------------------

SQL code
select HelpDateTime  into # from Shop_Help where  isDate(HelpDateTime )=1
select * from # where HelpDateTime < '2009-06-22'

------解决方案--------------------
HelpDateTime 的问题。