摘自:OFFICE中国 Trynew
将秒为单位的如98989.90秒,转化为:时:分:**.**的形式的函数,如果前面是0则不显示!!
Function SecToTime(dblSecond As Double) As String
SecToTime = Format((Int(dblSecond) / 60 / 60 / 24), "HH:MM:SS")
If Int(dblSecond) <> dblSecond Then SecToTime = SecToTime & Round(dblSecond - Int(dblSecond), 2)
SecToTime = IIf(Left(SecToTime, 6) = "00:00:", Mid(SecToTime, 7), IIf(Left(SecToTime, 3) = "00:", Mid(SecToTime, 4), SecToTime))
End Function
Access软件网交流QQ群(群号:198465573) |