OKCMikeSoll
MIS
I am using CR 9 reporting on an oracle database. I have a report that is calculating the average open time of helpdesk tickets that are in an open status. Listed below are the formulas I am using and they are giving me the correct average age but the average age includes the 48 hours from the weekend, which I was told my @TimeDiff formula would backout. The only difference is that in the @TimeDiff formula I changed it from the "d" to the "s" beucase I need the difference in seconds. Any thoughts?
//@TimeDiff
//I use this to give me the number of seconds between to dates and backout the weekends.
DateDiff("s",{@CST_OpenTime},{@DateVar}) -
DateDiff("ww",{@CST_OpenTime},{@DateVar},crsaturday) -
DateDiff("ww",{@CST_OpenTime},{@DateVar},crsunday);
//@DateVar (This gives me a "stop time" to use in the @TimeDiff formula
DateVar abc:=CurrentDate-1;
NumberVar mon:=Month(abc);
NumberVar dy:=Day(abc);
NumberVar yr:=Year(abc);
DateTime(yr,mon,dy,23,59,59)
//@TimeDiffGroup - formula gives me the average for all the tickets in seconds then converts to days:hours:mins:secs
Local NumberVar TotalSec := Average ({@TimeDiff},{PROBSUMMARYM1.ASSIGNMENT}) ;
Local NumberVar Days := Truncate (TotalSec / 86400);
Local NumberVar Hours := Truncate (Remainder ( TotalSec,86400) / 3600);
Local NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);
Local NumberVar Seconds := Remainder ( TotalSec , 60);
Totext ( Days, '00', 0,'') + ':'+
Totext ( Hours, '00', 0,'') + ':'+
Totext ( Minutes,'00', 0,'') + ':'+
Totext ( Seconds,'00', 0,'')
Thanks in advance..
Mike Soll
//@TimeDiff
//I use this to give me the number of seconds between to dates and backout the weekends.
DateDiff("s",{@CST_OpenTime},{@DateVar}) -
DateDiff("ww",{@CST_OpenTime},{@DateVar},crsaturday) -
DateDiff("ww",{@CST_OpenTime},{@DateVar},crsunday);
//@DateVar (This gives me a "stop time" to use in the @TimeDiff formula
DateVar abc:=CurrentDate-1;
NumberVar mon:=Month(abc);
NumberVar dy:=Day(abc);
NumberVar yr:=Year(abc);
DateTime(yr,mon,dy,23,59,59)
//@TimeDiffGroup - formula gives me the average for all the tickets in seconds then converts to days:hours:mins:secs
Local NumberVar TotalSec := Average ({@TimeDiff},{PROBSUMMARYM1.ASSIGNMENT}) ;
Local NumberVar Days := Truncate (TotalSec / 86400);
Local NumberVar Hours := Truncate (Remainder ( TotalSec,86400) / 3600);
Local NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);
Local NumberVar Seconds := Remainder ( TotalSec , 60);
Totext ( Days, '00', 0,'') + ':'+
Totext ( Hours, '00', 0,'') + ':'+
Totext ( Minutes,'00', 0,'') + ':'+
Totext ( Seconds,'00', 0,'')
Thanks in advance..
Mike Soll