I have an interger that i want to convert into hh:mm:ss format like 00:00:00. is was able to do that using the follwowing code but i know its SO crude.
If LEN(TRIM(Totext(Truncate({AgentStateDaily;1.AvailableTime}/3600),0))) < 2 THEN
FORMULA = "0" + TRIM(Totext(Truncate({AgentStateDaily;1.AvailableTime}/3600),0))
Else
FORMULA = TRIM(Totext(Truncate({AgentStateDaily;1.AvailableTime}/3600),0))
END IF
If LEN(TRIM(ToText(Truncate(Remainder({AgentStateDaily;1.AvailableTime}, 3600)/60),0))) < 2 Then
FORMULA = FORMULA + ":" + "0"+ TRIM(ToText(Truncate(Remainder({AgentStateDaily;1.AvailableTime}, 3600)/60),0))
Else
FORMULA = FORMULA + ":" + TRIM(ToText(Truncate(Remainder({AgentStateDaily;1.AvailableTime}, 3600)/60),0))
END IF
If LEN(TRIM(ToText(Truncate(Remainder ({AgentStateDaily;1.AvailableTime},60 )),0))) < 2 Then
FORMULA = FORMULA + ":" + "0"+ TRIM(ToText(Truncate(Remainder ({AgentStateDaily;1.AvailableTime},60 )),0))
Else
FORMULA = FORMULA + ":" + TRIM(ToText(Truncate(Remainder ({AgentStateDaily;1.AvailableTime},60 )),0))
END IF
IS THERE ANY WAY I CAN DO THIS THE SHORTEST.
Thanks in advance!
If LEN(TRIM(Totext(Truncate({AgentStateDaily;1.AvailableTime}/3600),0))) < 2 THEN
FORMULA = "0" + TRIM(Totext(Truncate({AgentStateDaily;1.AvailableTime}/3600),0))
Else
FORMULA = TRIM(Totext(Truncate({AgentStateDaily;1.AvailableTime}/3600),0))
END IF
If LEN(TRIM(ToText(Truncate(Remainder({AgentStateDaily;1.AvailableTime}, 3600)/60),0))) < 2 Then
FORMULA = FORMULA + ":" + "0"+ TRIM(ToText(Truncate(Remainder({AgentStateDaily;1.AvailableTime}, 3600)/60),0))
Else
FORMULA = FORMULA + ":" + TRIM(ToText(Truncate(Remainder({AgentStateDaily;1.AvailableTime}, 3600)/60),0))
END IF
If LEN(TRIM(ToText(Truncate(Remainder ({AgentStateDaily;1.AvailableTime},60 )),0))) < 2 Then
FORMULA = FORMULA + ":" + "0"+ TRIM(ToText(Truncate(Remainder ({AgentStateDaily;1.AvailableTime},60 )),0))
Else
FORMULA = FORMULA + ":" + TRIM(ToText(Truncate(Remainder ({AgentStateDaily;1.AvailableTime},60 )),0))
END IF
IS THERE ANY WAY I CAN DO THIS THE SHORTEST.
Thanks in advance!