Skip to Content
0
Jun 07, 2018 at 02:23 PM

Crystal Reports: difference in two time fields

159 Views

I'm using the following formula to calculate the time difference in two time fields which are strings.

NumberVar TotalSec :=  Time({@DispatchTime}) - Time({@PhoneTime});
NumberVar Hours   := Truncate ( TotalSec / 3600);
NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);
Totext ( Hours,  '####') + ':'+ Totext ( Minutes,'00');

The formula works, but it does not factor in seconds. How do I add the seconds into this?