从 char 数据类型到 datetime 数据类型的转换导致 datetime 值越界

 select e_salecode as salecode ,count(e_quantity)as quantity from e_stockout
  where datediff(d,e_entertime,getdate())=0 and e_stockid =3 group by e_salecode

执行后说从 char 数据类型到 datetime 数据类型的转换导致 datetime 值越界

select e_salecode as salecode ,count(e_quantity)as quantity from e_stockout
  where datediff(d,convert(varchar(10),e_entertime,20) ,getdate())=0 and e_stockid =3 group by e_salecode

执行通过

posted @   放哨De老鼠  阅读(959)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示