Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding up Duration in a Running Total

Status
Not open for further replies.

JHear1

Technical User
May 4, 2001
14
0
0
US
I am trying to total up application outage durations in a year to date report. I have the report of applications and the outage durations for each instance that it was down. I cautiously assume I now need to create a running total to display the total duration for each application, but I dont' see a way to total HH:MM:SS in the wizard.
Example:

Application Name Outage Date Duration
Crystal Enterprise 03/10/05 00:30:00
Crystal Enterprise 05/19/05 01:45:00

Total 02:15:00

If it's something simple that I forgot, just send me a kick with the tip cause I don't see it, and I think I searched every inch of this web site.

Thanks
 
I would firsts convert the times to seconds as in {@seconds}:

hour({@time}) * 3600 + minute({@time})*60 + second({@time})

Then you can use a formula like the one in SynapseVampire's FAQ to convert the result back to a time-like display:

numberVar dur := sum({@seconds},{table.application};
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00");

hhmmss

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top