Help with tracking Holdays and weekends
Posted on 2003-11-18
I have scanned the database looking for a solution , however they all seem to do more than I need(I think).
I need to calculatre out weekends and holidays. I have the following that does weekends
diffDays := (EndDate - StartDate) / 86400 + 1;
strtDay := @Modulo(@Weekday(StartDate); 7);
endDay := @Modulo(@Weekday(EndDate); 7);
result := (diffDays - endDay + strtDay - 8) * 5 / 7 - @Max(-2; -strtDay) - @Min(1; endDay) + 5 - strtDay + endDay ;
The other caveate is that this is for a multinational company therefore depending on the value in the Country field there may or may not be a holiday.
e.g. United States 27/11/2003
We in Canada and United Kingdom do not get that as a Holiday
I know there will have to form with the holidays on it and a view. The current form contains an Event/Holiday field and a Start and End Date. Is there any thing else this form requires? Country Field maybe or can I look up to the employee profile document to retrieve this?
Any help greatly appreciated