I have an attendance database that tracks associates times out of the office. Currently I do monthly reports by the start date of the request. That is fine for some areas, but others are running into an issue.
When someones time off runs over two months, they want to be able to seperate out that request to reflect the correct time off during the month. For example. Someone takes vacation from 6/28/2010 to 07/09/2010 and return on 7/12.
I have the code right now that will explode the dates and subtract out the weekends and holiday to get the correct number of days off. So, this would be a total days of 9 days out of the office, minus Sat. Sun and the observed holiday on 7/5.
I need to be able to create view or something, so that it would display the correct time used each month. So it would say for June that the associate used 24 hours and in July they used 48 hours.
I have a field right now to calulate the days with the code:
tDateRange := @Date(@TextToTime(@Text(DISP_Start) + "-" + @Text(DISP_END)));
tHolidayList := "01/01/2010":"05/31/2010":"07/05/2010":"09/06/2010":"11/25/2010":"12/24/2010":"01/01/2011";
tDateList := @If(tDateRange = ""; ""; @Date(@TextToTime(@Explode(tDateRange))));
tWeekday := @Text(@Weekday(tDateList));
tWkDayDate := tWeekday + "^" + @Text(tDateList);
tSats := @Right(tWkDayDate; "7^");
tSuns := @Right(tWkDayDate; "1^");
tList := @Trim(@ReplaceSubstring(@Text(tDateList); tSats : tSuns; ""));
tDays := @Trim(@Replace(tList; tHolidayList; ""));
But now I am struggling with how to extract the month from the list and have it display correctly. Each time I try to get the month to extract from this, I get either a Text Expected error or it will only convert the first date in the list to the month and ignores the rest.
I am only having this issue on actual full days out of the office. Since Partial Day requests are same day, this function is not needed.
Any ideas? I appreciate the help as usual! Thanks