Hello experts,
I am trying to get an average time in hh:mm:ss without counting the records with a zero value. From the results below you see the total is actually an average of all the 14 records but I only need an average of the four records that have a time. One of the column is in seconds and the other is converted to hh:mm:ss. Can someone please assist? The formula I used to convert the time is
NumberVar TotalSec := ({@AVGTime});
NumberVar Hours := Truncate (TotalSec / 3600) ;
NumberVar Minutes := Truncate (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;
Totext ( Hours , '00' ) + ':' +
Totext ( Minutes , '00' ) + ':' +
Totext ( Seconds , '00' )
Day @AVGTime hh:mm:ss @AVGTime in seconds
6/1/2011 00:00:00 0.00
6/2/2011 00:00:00 0.00
6/3/2011 00:00:00 0.00
6/4/2011 00:00:00 0.00
6/5/2011 00:09:57 597.00
6/6/2011 00:00:00 0.00
6/7/2011 00:00:00 0.00
6/8/2011 00:00:00 0.00
6/9/2011 00:11:52 712.00
6/10/2011 00:08:26 506.00
6/11/2011 00:00:00 0.00
6/12/2011 00:00:00 0.00
6/13/2011 00:00:00 0.00
6/14/2011 00:00:37 37.00
Total 00:02:12 132.29
I am trying to get an average time in hh:mm:ss without counting the records with a zero value. From the results below you see the total is actually an average of all the 14 records but I only need an average of the four records that have a time. One of the column is in seconds and the other is converted to hh:mm:ss. Can someone please assist? The formula I used to convert the time is
NumberVar TotalSec := ({@AVGTime});
NumberVar Hours := Truncate (TotalSec / 3600) ;
NumberVar Minutes := Truncate (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;
Totext ( Hours , '00' ) + ':' +
Totext ( Minutes , '00' ) + ':' +
Totext ( Seconds , '00' )
Day @AVGTime hh:mm:ss @AVGTime in seconds
6/1/2011 00:00:00 0.00
6/2/2011 00:00:00 0.00
6/3/2011 00:00:00 0.00
6/4/2011 00:00:00 0.00
6/5/2011 00:09:57 597.00
6/6/2011 00:00:00 0.00
6/7/2011 00:00:00 0.00
6/8/2011 00:00:00 0.00
6/9/2011 00:11:52 712.00
6/10/2011 00:08:26 506.00
6/11/2011 00:00:00 0.00
6/12/2011 00:00:00 0.00
6/13/2011 00:00:00 0.00
6/14/2011 00:00:37 37.00
Total 00:02:12 132.29