Sql 中怎么计算两日期间的天数

Sql 中如何计算两日期间的天数
我想将日期转化为第n个工作日(起始时间为3/1/2006),工作日不包含周六和周日以及一些特定的假期(holiday表给出)。请问有没有办法

------解决方案--------------------
select datediff(day, '2007-01-01 ',getdate())-(select count(1) from holiday where dt <getdate())

类似这样
------解决方案--------------------
假如你的有可能和周六和周日重叠那么这样
declare @stasun int,@add int
set @stasun =datediff(day, '2007-03-01 ',getdate())
set @add=case when (@stasun % 7)=2 then 1 when (@stasun % 7)> 2 then 2 end
select @stasun-(select count(1) from holiday where datediff(day, '2007-03-03 ',dt) % 7 > =2)- (@stasun /7)*2 -@add