select dateadd(day,number,convert(date,dateadd(DD,-7,getdate()),23)) as date
from master.dbo.spt_values where type ='P'
and number <=DATEDIFF(day, convert(date,dateadd(DD,-7,getdate()),23), GETDATE()+13)
SQL server 获取一周前到两周后之间的所有日期
最新推荐文章于 2023-06-29 18:28:22 发布