日期:2014-05-18 浏览次数:20522 次
create table bz_workday (hdate datetime,name char(20)) insert into bz_workday select '2011-01-01 00:00:00.000','元旦' insert into bz_workday select '2011-01-02 00:00:00.000','元旦' insert into bz_workday select '2011-01-03 00:00:00.000','元旦' insert into bz_workday select '2011-01-08 00:00:00.000','星期六' insert into bz_workday select '2011-01-09 00:00:00.000','星期日' insert into bz_workday select '2011-01-15 00:00:00.000','星期六' insert into bz_workday select '2011-01-16 00:00:00.000','星期日' insert into bz_workday select '2011-01-22 00:00:00.000','星期六' insert into bz_workday select '2011-01-23 00:00:00.000','星期日' insert into bz_workday select '2011-01-29 00:00:00.000','星期六' insert into bz_workday select '2011-01-30 00:00:00.000','星期日' insert into bz_workday select '2011-02-01 00:00:00.000','春节' insert into bz_workday select '2011-02-02 00:00:00.000','春节' insert into bz_workday select '2011-02-03 00:00:00.000','春节' insert into bz_workday select '2011-02-04 00:00:00.000','春节' insert into bz_workday select '2011-02-05 00:00:00.000','春节' insert into bz_workday select '2011-02-06 00:00:00.000','春节' insert into bz_workday select '2011-02-07 00:00:00.000','春节' insert into bz_workday select '2011-02-08 00:00:00.000','春节' insert into bz_workday select '2011-02-12 00:00:00.000','星期六' insert into bz_workday select '2011-02-13 00:00:00.000','星期日' insert into bz_workday select '2011-02-19 00:00:00.000','星期六' insert into bz_workday select '2011-02-20 00:00:00.000','星期日' insert into bz_workday select '2011-02-26 00:00:00.000','星期六' insert into bz_workday select '2011-02-27 00:00:00.000','星期日' go select COUNT(*)*7.5*60 worktime --根据楼主的标准,每天工作时间为7.5小时 from master..spt_values a where type='p' and DATEADD(d,number,'2011-01-01')<'2012-01-01' and not exists(select 1 from bz_workday where hdate=DATEADD(d,number,'2011-01-01')) /* worktime ---------------------------