Hi,
I am trying to figure out how to calculate the number of business days between two dates.
I have VacationRequest.BeginningDate and VacationRequest.EndDate. Is it possible to adapt COUNT and BUSINESS_DAY_FORWARD somehow to perform this function?
Thanks,
Pete
Counting Business Days
-
- Posts: 304
- Joined: Fri Jun 22, 2007 8:26 pm
-
- Posts: 304
- Joined: Fri Jun 22, 2007 8:26 pm
Hi Chris,
I appreciate the assistance. Their vacation policy is that they have a set number of vacation days available to them within a calendar year and I want to track what they have used up and what they have available to them. I could just get them to request dates that are not weekends and count the days that they request but I was hoping to just get them to choose the beginning and end dates of their vacations and have the system calculate the vacation days between those two dates excluding weekends and statutory holidays.
Cheers,
Pete
I appreciate the assistance. Their vacation policy is that they have a set number of vacation days available to them within a calendar year and I want to track what they have used up and what they have available to them. I could just get them to request dates that are not weekends and count the days that they request but I was hoping to just get them to choose the beginning and end dates of their vacations and have the system calculate the vacation days between those two dates excluding weekends and statutory holidays.
Cheers,
Pete
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
Pete,
Try adding a numeric attribute DayCount with default value of 0 and the following rule to object VacationRequest:
If BUSINESS_DAY_FORWARD(VacationRequest.BeginningDate, VacationRequest.DayCount) <= VacationRequest.EndDate
Then INCREASE VacationRequest.DayCount BY 1
Tick the While Semantics checkbox on the Advanced tab for the rule. This will force the rule to execute repeatedly until the calculated date moves past the vacation end date. See the While Semantics sections in the User Guide for details on how it works.
Try adding a numeric attribute DayCount with default value of 0 and the following rule to object VacationRequest:
If BUSINESS_DAY_FORWARD(VacationRequest.BeginningDate, VacationRequest.DayCount) <= VacationRequest.EndDate
Then INCREASE VacationRequest.DayCount BY 1
Tick the While Semantics checkbox on the Advanced tab for the rule. This will force the rule to execute repeatedly until the calculated date moves past the vacation end date. See the While Semantics sections in the User Guide for details on how it works.
Aware IM Support Team