数据库中getdate()获得的时间都是精确到秒的,如果直接在这个基础上进行加减运算,可能没法得到只有年月日的结果,因此:
DATEADD(dd,7,convert(varchar(100), getdate(), 23)=给定年月日
这样就可以了
数据库中getdate()获得的时间都是精确到秒的,如果直接在这个基础上进行加减运算,可能没法得到只有年月日的结果,因此:
DATEADD(dd,7,convert(varchar(100), getdate(), 23)=给定年月日
这样就可以了