当前位置: 代码迷 >> Sql Server >> sql时间查询的有关问题
  详细解决方案

sql时间查询的有关问题

热度:51   发布时间:2016-04-27 19:16:58.0
sql时间查询的问题,
SQL code
select * from VerificationTable  where VerificationStarTime>='2008-07-22' and VerificationStarTime<='2011-12-08 23:59:59'


错误:
消息 241,级别 16,状态 1,第 1 行
从字符串转换日期和/或时间时,转换失败。


咋会这样呢?? 求解救

------解决方案--------------------
SQL code
select * from VerificationTable  where cast(VerificationStarTime as datetime)>='2008-07-22 00:00:000' and cast(VerificationStarTime as datetime)<='2011-12-08 23:59:599
  相关解决方案