日期:2014-05-17 浏览次数:20422 次
declare @m int
declare @y int
set @m = 2 --这两个变量从你前台获取值即可
set @y = 2013
SELECT DATEADD(dd,number,'2013-01-01')
FROM master..spt_values M
WHERE type ='P'
AND DATEPART(wk,DATEADD(dd,number,'2013-01-01')) =@m
AND YEAR(DATEADD(dd,number,'2013-01-01'))=@y