I use this to convert a time recorded in seconds in a database maybe it will help
IF {fld} > 0 THEN
If Val (TOTEXT(TRUNCATE( {fld}3600),0)) <= 9 Then
'0'+ TOTEXT(TRUNCATE( {fld}/3600),0) + ":" +
If (Remainder ({fld}/3600) /3600 *60) <= 9 Then
'0' + ToText( Truncate(Remainder ({fld},3600) /3600 *60,0),0) //converts decimal into minutes
Else
If Truncate( REMAINDER ( {fld},3600)/60,0) <= 9 Then
'0' + ToText( Truncate( Remainder ({fld},3600) /3600 *60,0),0) //converts decimal into minutes
Else
TOTEXT( Truncate( REMAINDER ( {fld},3600)/60,0),0) //converts decimal into minutes
Else
If (Remainder ({fld},3600) /3600 *60) <= 9 Then
TOTEXT(TRUNCATE( {fld}/3600),0) + ":" + // changes seconds into hours
'0' + ToText( Truncate( Remainder ({fld},3600) /3600 *60,0),0) //converts decimal into minutes
Else
TOTEXT(TRUNCATE( {fld}/3600),0) + ":" + //changes seconds into hours
If Truncate( REMAINDER ( {fld},3600)/60,0) <= 9 Then
'0' + ToText( Truncate( Remainder ({fld},3600) /3600 *60,0),0) //converts decimal into minutes
Else
TOTEXT( Truncate( REMAINDER ( {fld},3600)/60,0),0) //+'*' //converts into minutes
ELSE
" : "