Hi All
I have the formula below which allows me to calculate the business hours elapsed between the "occurred date" and the "solved date" on a ticket/ job.
I also want to calculate and display the business hours elapsed if the ticket / job are still open. How can I incorporate this into my existing formula....?
++++++++++++++++++++++++++++++++++++
Global TimeVar SLAHoursStart := CTime("08:00:00");
Global TimeVar SLAHoursEnd := CTime("18:00:00");
Global DateTimeVar DateLogged :=
{@Occurred On};
Global DateTimeVar DateSolved :=
{@Solved On};
Global NumberVar HoursOnStartDay;
Global NumberVar HoursOnEndDay;
Global NumberVar HoursOnToday;
Global NumberVar TotalHours;
Global NumberVar MinSat := DateDiff ("ww", DateLogged, DateSolved, crSaturday);
Global NumberVar MinSun := DateDiff ("ww", DateLogged, DateSolved, crSunday);
Global NumberVar RemDays;
Global NumberVar TotalBusDaysBetween2 := DateDiff("d",DateLogged,DateSolved);
Global NumberVar TotalBusDaysBetween := (TotalBusDaysBetween2 - (MinSat+MinSun))+1;
Global TimeVar TimeLogged := CTime(
{@Occurred On});
Global TimeVar TimeSolved := CTime(
{@Solved On});
TotalHours := DateDiff ("h",DateLogged,DateSolved);
HoursOnStartDay := (SLAHoursEnd - TimeLogged) / 3600; //Divide by 3600 to convert seconds to hours
HoursOnEndDay := (TimeSolved - SLAHoursStart) / 3600; //Divide by 3600 to convert seconds to hours
HoursOnToday := (CURRENTTIME - SLAHoursStart) / 3600; //Divide by 3600 to convert seconds to hours
If (cDate(DateLogged) - cDate(DateSolved)) = 0 Then
(TimeSolved - TimeLogged) / 3600
Else If (cDate(DateLogged) - cDate(DateSolved)) = 1 Then
HoursOnStartDay + HoursOnEndday
Else
((TotalBusDaysBetween * 10) - 20) + HoursOnStartDay + HoursOnEndday;
++++++++++++++++++++++++++++++++++++
Any advice greatly appreciated. :)
Regards
Paula