CONVERTER MILESEGUNDOS EM HH:MM:SS

USUARIO.EXCLUIDOS 03/05/2005 03:39:54
#81375
Olá pessoal eu tenho essa seguinte função para converter milesegundos em hh:mm:ss. Ela funciona perfeitamente, mas tem como eu converter para a formula do crystal report 8.5? Pois estou precisando usa-la no crystal report e eu não manjo muito de formula.

Public Function ConvertMMSec(ByVal TimeIn As Long) As String

Dim intH As Integer, intM As Integer, intS As Integer
Dim TMP As Long
Dim strTime As String

TMP = TimeIn / 1000
intH = Int(TMP / 3600)
TMP = TMP Mod 3600
intM = Int(TMP / 60)
TMP = TMP Mod 60
intS = TMP
If intH > 0 Then
strTime = Trim(Str(intH)) & ":"
Else
strTime = ""
End If
If intM >= 10 Then
strTime = strTime & Trim(Str(intM))
ElseIf intM > 0 Then
strTime = strTime & "0" & Trim(Str(intM))
Else
strTime = strTime & "00"
End If
strTime = strTime & ":"
If intS >= 10 Then
strTime = strTime & Trim(Str(intS))
ElseIf intS > 0 Then
strTime = strTime & "0" & Trim(Str(intS))
Else
strTime = strTime & "00"
End If
ConvertMMSec = strTime
End Sub


Obrigado
[]'s
USUARIO.EXCLUIDOS 03/05/2005 07:35:46
#81380
kra, não sei fazer o que você quer, mas a sua função tá complicada demais, usa essa (usando o msm nome da sua função).


Public Function ConvertMMSec(ByVal TimeIn As Long) as Date
ConvertMMSec = DateSerial(0,0,TimeIn\1000)
End Sub
USUARIO.EXCLUIDOS 03/05/2005 11:27:21
#81418
Eu queria só converter essa funçaõ pra usar no crystal report. No vb eu consigo usar normalmente. Só no crystal report que não consigo
Tópico encerrado , respostas não são mais permitidas