Try this:
select a.id,a.start_date,a.end_date,sum(cast(workday as tinyint)) as NumWorkDays,
count(*) as Total_days
from idTable a
join workdaytable b on b.eday between a.start_date and a.end_Date
group by a.id,a.start_date,a.end_date
To visualize what is happening
select a.id,a.start_date,a.end_date
where id=123
id start_date end_date
123 1/1/2013 3/1/2013
returns one row for id=123
Now, when we do the join, we add e_day and the workday flag columns AND we add one row for each e_day in the second table
id start_date end_date e_day work_day
123 1/1/2013 3/1/2013 1/1/2013 0
123 1/1/2013 3/1/2013 1/2/2013 1
123 1/1/2013 3/1/2013 1/3/2013 1
etc.
Now we had a big "table" with 5 columns and one row for each day in the second table that falls between 1/1/2013 and 3/1/2013. The Sum operation simply adds all of the work_day flag from the "table" we created by the join. If you run the query without the JOIN (and remove the sum and count), you can see the "table" that gets created...
Hope this helps a bit...