I am developing a helpdesk system, where I want the Due Date to reflect as soon as I enter the Severity levelSev 1: 2 business hours to resolve
Sev 2: 5 business hours to resolve
Sev 3: 10 business hours to resolve
Sev 4: Due Date driven - HelpDesk Operator can set this date.
How do I only include business hours (8am-5pm) and Business days in this equation?
Or if anyone has a solution, or suggestions, please help!
I found 2 pieces on this forum :
Calculate End Date w/start date and set number of business days excluding holidays and weekends
Posted by Patti Albracht on 14.Jan.05 at 11:45 AM using a Web browser
Category: Domino DesignerRelease: 6.0.2 CF2Platform: Windows XP
I was looking for a post to calculate an end date with the known items being the starting date and the holidays and a set number of business days. I didn't find anything, but I came up with a simple solution.
Field = Holidays - Text multiple mm/dd/yyyy
Field = StartDate - Date
Field = EndDate
Button to calculate end date.
Button code:
CurrDate:=StartDate;
BusinessDays:=0;
TotalDays:=0;
n:=0;
@DoWhile(
CurrDate:=@Adjust(CurrDate;0;0;1;0;0;0);
TotalDays:=TotalDays+1;
BusinessDays:=@If((@Weekday(CurrDate) = 1 | @Weekday(CurrDate) = 7) | @IsMember(@Text(CurrDate; "D0S0"); Holidays); BusinessDays; BusinessDays + 1);
@If(BusinessDays=10; 0; 1)
);
FIELD EndDate := CurrDate;
Calculating # of Business Hours between two dates/times
Posted by Adam Fenstermaker on 6.Oct.04 at 10:15 AM using a Web browser
Category: Domino DesignerRelease: All ReleasesPlatform: All Platforms
I’ve been in need of this formula in the past to measure turnaround and have always done it with LotusScript. I was trying to find a post in the forum or the sandbox that used the new R6 @BusinessDays that did this - so when I didn’t here’s what I came up with - please respond if you find bugs - hopefully it prevents someone else from re-creating the wheel.
REM {INITIALIZE VARIABLES};
_StartDate := @Date(IP_Date_Requested);
_StartTime := @Time(IP_Time_Requested);
_EndDate := @Date(IP_Date);
_EndTime := @Time(IP_Time);
_HolidayList := [12/25/04];
REM {ADJUST TIMES TO NOT COUNT HOURS BEFORE 8 OR AFTER 5};
_StartTime := @If(_StartTime - [8:00 AM] < 0;[8:00 AM];_StartTime - [5:00 PM] > 0; [5:00 PM];_StartTime);
_EndTime := @If(_EndTime - [8:00 AM] < 0;[8:00 AM];_EndTime - [5:00 PM] > 0; [5:00 PM];_EndTime);
REM {DETERMINE # OF BUSINESS DAYS IN DATE RANGE};
_BusinessDays := @BusinessDays(_StartDate;_EndDate;1:7;_HolidayList);
_StartDayIsBiz := @BusinessDays(_StartDate;_StartDate;1:7;_HolidayList);
_EndDayIsBiz := @BusinessDays(_EndDate;_EndDate;1:7;_HolidayList);
REM {CALC # OF BUSINESS DAYS BETWEEN DATES};
_DaysBetween := _BusinessDays - _StartDayIsBiz - _EndDayIsBiz;
REM {ASSUME 9 HOURS IN BUSINESS DAY - 8:00 AM TO 5:00 PM};
_HoursBetween := @If(_DaysBetween > 0;_DaysBetween * 9;0);
REM {CALCULATE # OF BUSINESS HOURS IN FIRST DAY};
_StartDayHours := @If(_StartDayIsBiz = 0;0;
_EndDate - _StartDate = 0;(_EndTime - _StartTime)/3600;
([5:00 PM] - _StartTime)/3600
);
REM {CALCULATE # OF BUSINESS HOURS IN LAST DAY};
_EndDayHours := @If(_EndDayIsBiz = 0;0;
_EndDate - _StartDate = 0;0;
(_EndTime - [8:00 AM])/3600
);
@Round(_StartDayHours;0.1) + _HoursBetween + @Round(_EndDayHours;0.1);
I just cannot seem to get the 2 together?
Please help!