Print Page | Close Window

Averaged hh,mm,ss to seconds

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3780
Printed Date: 18 May 2024 at 1:51pm


Topic: Averaged hh,mm,ss to seconds
Posted By: sjr40
Subject: Averaged hh,mm,ss to seconds
Date Posted: 23 Jul 2008 at 2:44am
I have several fields created with the code below :
 
local numberVar RemainingSeconds;
local numberVar Hours;
local numberVar Minutes;
local numberVar Seconds;
Hours := Truncate (( mailto:%7b@average - {@average seconds})/3600);
RemainingSeconds := ( mailto:%7b@average - {@average seconds}) - (Hours*3600);
Minutes := Truncate ( mailto:%7b@average - {@average seconds}/60);
Seconds := ( mailto:%7b@average - {@average seconds}) - (Hours*3600) - (Minutes*60);
totext(Hours,"00") + "hrs " +
totext(Minutes,"00") +"mins " +
totext(Seconds,"00") +"secs ";
 
As you can see they are averaged times.
I now have to sum these averaged fields for subtotals per record.
How can I do this ?
Do I convert each field back to seconds, sum then convert back to hh, mm, ss format ?
Proving really tricky due to the averaging of  the times.
Thanks



Print Page | Close Window