# Finding number of weeks within a period

M

#### MaggieL

My data consists of StartDate, EndDate, StartTime, EndTime, Mon, Tue, Wed,
Thur, Fri, Sat, Sun (days of week are check box format y/n)

I need to calculate the NumOfHours for an event. For example:
StartDate: 2/1/2010
EndDate: 2/15/2010
StartTime: 6:00M
EndTime: 7:00M
Mon is checked
The NumOfHours should = 2

I can calculate the NumHrsPerDay and the NumOfDaysPerWk BUT.....
can't seem to get the last part which is how many Mondays are in the date
period.
Thanks, Margaret

J

#### John W. Vinson

My data consists of StartDate, EndDate, StartTime, EndTime, Mon, Tue, Wed,
Thur, Fri, Sat, Sun (days of week are check box format y/n)

I need to calculate the NumOfHours for an event. For example:
StartDate: 2/1/2010
EndDate: 2/15/2010
StartTime: 6:00M
EndTime: 7:00M
Mon is checked
The NumOfHours should = 2

I can calculate the NumHrsPerDay and the NumOfDaysPerWk BUT.....
can't seem to get the last part which is how many Mondays are in the date
period.
Thanks, Margaret

DateDiff("ww", [StartDate], [EndDate], 2)

The 2 means that the week starts on Monday, so the function will count the
number of sunday-to-monday boundaries between the dates.