Counting days in period 2016-06-27 till 2016-07-11 excluding saturdays and sundays, gives me 11 days, so in your example the 80 hoursworked should result in 11 records with 7.27 (or 7) hoursworked - true or false?
The tally table could be numbers from 1 till (lets say) 60 (almost 2 months), and the calculation could then be done like this:
create table dbo.tally(n int);
go
insert into dbo.tally(n)
select row_number() over(order by (select null))-1
from (values(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
) as tally(n)
;
select a.employeeid
,dateadd(day,b.n,a.periodbegindate) as periodday
,a.hoursworked*1./count(*) over(partition by a.employeeid,a.periodbegindate) as hoursworked
from yourtable as a
cross apply tally as b
where a.periodenddate>=dateadd(day,b.n,a.periodbegindate)
and datepart(weekday,dateadd(day,b.n,a.periodbegindate)) in (2,3,4,5,6)
order by a.employeeid
,periodday
;
If you don't want a tally table (hanging around), you could create one on the fly:
with tally(n)
as (select row_number() over(order by (select null))-1 as n
from (values(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
,(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)
) as tally(n)
)
select a.employeeid
,dateadd(day,b.n,a.periodbegindate) as periodday
,a.hoursworked*1./count(*) over(partition by a.employeeid,a.periodbegindate) as hoursworked
from yourtable as a
cross apply tally as b
where a.periodenddate>=dateadd(day,b.n,a.periodbegindate)
and datepart(weekday,dateadd(day,b.n,a.periodbegindate)) in (2,3,4,5,6)
order by a.employeeid
,periodday
;