解决方法
谢谢t-clausen.dk,保存了几天.
为了得到每天的实例:
为了得到每天的实例:
declare @from datetime= '3/1/2013' declare @to datetime = '3/31/2013' select datediff(day,-7,@to)/7-datediff(day,-6,@from)/7 AS MON,datediff(day,-5,@from)/7 AS TUE,-4,@from)/7 AS WED,-3,@from)/7 AS THU,-2,@from)/7 AS FRI,-1,@from)/7 AS SAT,@from)/7 AS SUN