Let the storm money come!

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

            declare @startRange int 
    select @startRange = count(1)
        from UPM_BIZ.Process.SSC_Sta_WorkTime
        where '2011-10-21 8:20:00'  > convert(datetimeconvert(varchar(10),'2011-10-21 14:20:00'105+ ' ' + [time])
    print @startRange

    

    这段代码在查询分析器里没问题,但是放到函数里就会报我标题写的那个错误,将 convert 函数里的 105 改成 120 就可以了。 

posted @ 2011-10-21 17:40  精密~顽石  阅读(2566)  评论(0编辑  收藏  举报
在通往地狱的路上,加班能使你更快到达。