Friday, October 19, 2012

Crystal Report: Convert Total Seconds to HH:MM:SS Format


Lets say the total seconds is 6214:

NumberVar TotalSec :=  6214;
NumberVar Hours   := Truncate  (Remainder ( TotalSec , 86400) / 3600) ;
NumberVar Minutes := Truncate  (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;
Totext ( Hours ,   '00' ) +  ':' +
Totext ( Minutes , '00' ) +  ':' +
Totext ( Seconds , '00' ) 


No comments:

Post a Comment

Your comment is much appreciated. Thanks :)