标签:
SELECT CountDate=CONVERT(CHAR(10),DATEADD(DAY,0-rn,GETDATE()),20) FROM (SELECT TOP 7 rn=row_number() OVER(ORDER BY GETDATE())-1 FROM sysobjects)t ORDER BY CountDate
结果如下图
获取最近几天日期
原文地址:http://www.cnblogs.com/ecosu/p/5112643.html