标签:
set datefirst 1 select count(*) from
(select date from(select dateadd(dd,number,‘2015-01-01‘) date from master..spt_values where [type] = ‘p‘ and number >= 0 and number < datediff(dd,‘2015-01-01‘,‘2016-01-01‘)) t
where datepart(week,date) = (select DATENAME(week,@date))) a , bbreport b
where substring(b.date,1,10) = convert(char(10),a.date,120) and cmsid=‘014811‘
标签:
原文地址:http://www.cnblogs.com/pp521/p/4779041.html