Talk with the Author
 Crystal Reports Forum : General Information : Talk with the Author
Message Icon Topic: Sum & Average of times Post Reply Post New Topic
Author Message
hayfsh
Newbie
Newbie


Joined: 29 Oct 2013
Online Status: Offline
Posts: 10
Quote hayfsh Replybullet Topic: Sum & Average of times
    Posted: 22 Jul 2014 at 10:45pm
Hello

I am looking for some help in creating a formula which will give me the total time spent on calls during a period.

I have used the below formula to calculate the time spent on each call, but I need to sum this total but an struggling to find a solution.

NumberVar TotalSec := DateDiff ("s" ,{work_order.work_started_date_time}, {work_order.work_finished_date_time});
NumberVar Days    := Truncate (TotalSec / 86400);
NumberVar Hours   := Truncate (Remainder ( TotalSec , 86400) / 3600) ;
NumberVar Minutes := Truncate (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;

if Days >= 1 and Hours < 24 then Totext ( Days ,    '00' ) + ' Days' +chr(13) + Totext ( Hours ,   '00' ) + ' Hours' + chr(13) + Totext ( Minutes , '00') + ' Mins'
else
if Hours >= 1 and Hours < 24 then Totext ( Hours ,   '00' ) + ' Hours' + chr(13) + Totext ( Minutes , '00') + ' Mins'
else
if Minutes >=0 and Hours < 1 then Totext ( Minutes , '00') + ' Mins';


Further to the above total I will then need to find the average time spent on a call so any help on this also would be appreciated.

Cheers
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.027 seconds.