//判断服务器时间是否在数据表的时间段内
2000数据库
方法一:
SELECT *
FROM Y_huiyuanzaizhekou
WHERE (DATEDIFF(d, kaishiriqi, GETDATE()) >= 0) AND (zhixingflag = '是') AND
(DATEDIFF(d, GETDATE(), jieshuriqi) >= 0)
方法二:
SELECT *
FROM Y_huiyuanzaizhekou
WHERE (GETDATE() BETWEEN CONVERT(datetime, kaishiriqi, 20) AND CONVERT(datetime,
jieshuriqi, 20))