首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

一个sql时间比较的有关问题,很奇怪

2012-03-07 
一个sql时间比较的问题,很奇怪。ntime为int,wtime为datetimeSELECT*FROMworkingWHERE(wtime+ntime/60/24ge

一个sql时间比较的问题,很奇怪。
ntime为int,wtime为datetime

SELECT   *
FROM   working
WHERE   (wtime   +   ntime   /   60   /   24   <   getdate())

却把   ntime=685,wtime=2007-5-26   20:26:55的数据查询出来了,这是为什么?

[解决办法]
SELECT *
FROM working
WHERE (wtime + cast(ntime as float) / 60 / 24 < getdate())

热点排行
Bad Request.