sql语句中的到期查询

使用DATEDIFF函数,类如

select * from Patents where DATEDIFF(month,ApplicantDate,GETDATE())<=1 and DATEDIFF(month,ApplicantDate,GETDATE())>=0

查询距离查询日期一个月以内的数据。

猜你喜欢

转载自www.cnblogs.com/hanzq/p/12346294.html