I have timings in tottime column in access database
00:45:58
00:40:05
00:25:24
00:00:58
etc
how to calculate these timings.
Can you let me know.
00:45:58
00:40:05
00:25:24
00:00:58
etc
how to calculate these timings.
Can you let me know.
| Can you let me know. |
| Originally Posted by Doug G Not from the vague posting you made. Try providing the specifics of what you want to accomplish. |
| Originally Posted by sbhavan_s I want to get the total timings of those in asp |
' this function converts a number representing seconds
' and breaks it down into days, hours, minutes, seconds
Function ConvertSecondsToElapsedTime(iTotSeconds)
iDays = int(iTotSeconds / 86400)
iHours = int((iTotSeconds / 3600) - (iDays * 24))
iMinutes = int((iTotSeconds / 60) - (iDays * 1440) - (iHours * 60))
iSeconds = int((iTotSeconds mod 60))
ConvertSecondsToElapsedTime = iDays & " " & (iHours & ":" & iMinutes & ":" & iSeconds)
End Function
' this query converts tottime field to total seconds
Set oRs = oConn.Execute("SELECT Sum((Hour(tottime)*3600)+(Minute(tottime)*60)+Seco nd(tottime)) AS tot_secs " & _
"FROM your_table;")
If not oRs.eof then
iTotSeconds = oRs("tot_secs")
Response.write ConvertSecondsToElapsedTime(iTotSeconds)
End if
%>