I assume that you calculated your fields hoursWorked
and hoursWorked_1
the same way like in this formula shown. If that is the case, the fields hoursWorked
and hoursWorked_1
are from type "Date/Time" in document no matter how you define the fields in form.
That's why your formula should look like this:
thours:=@If(@IsNull(hoursWorked) | @IsNull(hoursWorked_1); @Return(""); "" );
nullTime := @ToTime("00:00");
seconds := (@ToTime(hoursWorked) - nullTime)+ (@ToTime(hoursWorked_1) - nullTime);
hours := @Integer(seconds/3600);
minutes := @Integer(@Modulo(seconds;3600)/60);
output := @Right("00" + @Text(hours); 2) + ":" + @Right("00" + @Text(minutes); 2);
@TextToTime(output)
Only first three lines are different to your formula.