你可以不用取时间比较,直接delete tablename
where datefield<dateadd(month,-2,getdate())如果没有符合条件的,这个语句不会产生副作用