T-SQL查询两个日期之间的休息日(周六周日)天数

SELECT COUNT(*) 
FROM MASTER..SPT_VALUES
WHERE TYPE = 'P'
AND DATEADD(DAY,NUMBER,'2014-03-13')<='2014-03-26'
AND DATEPART(WEEKDAY,DATEADD(DAY,NUMBER,'2014-03-13')) IN (6,7)

 

posted on 2014-03-27 16:48  万剑齐发  阅读(1112)  评论(0编辑  收藏  举报