时间的格式不正确。
YY-MM-DD
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天了错误就出现了!!!
怎么解决呀!!

解决方案 »

  1.   


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

  2.   


    什么意思?select HelpDateTime  into # from Shop_Help where  isDate(HelpDateTime )=1
      

  3.   

    HelpDateTime 这个字段名是在之前已经插入的。。是DATETIME。NOW()插入的值我现在是在做查询。。
      

  4.   

    这是mysql的吧,试试
    select HelpDateTime  from Shop_Help where  date_format(HelpDateTime,'%Y-%m-%d') < '2009-06-22' 
      

  5.   

    楼主需要看下你数据库的日期格式,有没有设定为特殊格式年--日--月,这样的话,估计有问题。还有楼主需要检查下你本机的语言和LOCATION ,看是不是简体中文。