Syd
I am not exactly sure what it is that you are trying to tell me but the line
of vba below gives the same result you got. Are you looking to write a
function that returns the string "0 Days 6 Hours 38 Minutes 5 Seconds" when
passed the number of seconds elapsed?
I am not aware of any "Magic" function in Access (or anywhere else for that
mater) that does this. I recommend that you write a function that first
calculates the numbers of Days in in the total number of seconds.
Days = TotalSeconds \ (CLng(60 * 60) * 24)
Then get the number of hours in the total number of seconds minus the total
number of seconds in the Days that you calculated above.
Hours = (TotalSeconds \ (60 * 60)) - (Days * 24)
Use the same logic to get the minutes
Minutes = (TotalSeconds \ 60) - ((CLng(Days * 24) * 60) + (Hours * 60))
and finally get the seconds using the Mod operator
Seconds = TotalSeconds Mod 60
All thats left to do is make a pretty string
YourString = Days & " Days " & Hours & " Hours " & Minutes & " Minutes " &
Seconds & " Seconds"
Ron W
Syd said:
Ron:
Thanks, however, the value of 23885.02 works out to be 23885.05(seconds) /
60 = 398.08366 / 60 is in reality 6 hour, 38 minutes and 5 seconds. Is there
a shorter method of accomplishing the same thing?