How to calculate work hours in a given date range

I was recently asked to calculate work hours between two dates for a productivity report and found a great function to do this on the Zen of SQL blog.
Below is code based on the function if you want to quickly test this out in SQL Server Management Studio. Just paste this code in and change the two dates at the top as desired:
declare @start_date datetime = '4/1/2014'
declare @end_date datetime = '4/30/2014'
select
((d.total_days / 7) * 5 + total_days % 7 -
case when 6 between start_week and end_week
then 1 else 0 end -
case when 7 between start_week and end_week
then 1 else 0 end) * 8
from
(select t.total_days, t.start_week,
t.start_week + t.total_days % 7 - 1 end_week
from
(select datediff(day, @start_date, @end_date) + 1 total_days,
datepart(weekday, @start_date +
@@datefirst - 1) start_week) t ) d
There are a few assumptions made in this code, please check the blog post for additional details.