Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating the Number of Weeks between Dates. Only held on certain days of week (Problem: Holidays)

Status
Not open for further replies.

borisbe

Technical User
Aug 15, 2005
73
US
I have version 9.

name mon tues wed thurs fri sat sun start_date end_date
test1 Y N Y N N N N 01/13/14 2/24/14
test2 Y N N N N N N 01/13/14 2/26/14

"Y" in a day of the week means it is being taught on those days of the week.

DATEDIFF("w", start_date, end_date, crMonday)+1 so each test shows that it is being held for 7 weeks but I now need to exclude holiday weeks:

test1 would be 7 weeks since they meet on Mon and Wed and only Mondays are holidays
test2 would be 5 weeks since they only meet on Mon so the weeks for MLK Day and President's Day weeks shouldn't be counted

Thanks!
 
Is MON set to N on days the class is not taught (holidays)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top