摘要:
1 declare @beginDate varchar(50) 2 set @beginDate = '2012-07-04' 3 select datepart(week,@beginDate) as 年内的第几周4 select dateadd(day,1-(datepart(weekday,@beginDate)),@beginDate) as 本周开始日期--(注意:每周是从周日开始,周一结束)5 select dateadd(day,1-(datepart(weekday,@beginDate))+6,@beginDate) as 本周截至日期6 select da 阅读全文