Help converting time...

kalebson

Registered User.
Local time
Today, 17:13
Joined
Sep 27, 2006
Messages
38
I am trying to convert a whole number to a start time w/ no luck. Assuming "0" is 12:00 AM, I have a start minute of "480" which would in essence be 8:00 AM. Can anyone tell me if I can somehow convert this to time in my query? Thanks.
 
TimeSerial(hour, minute, second)

the above function generates an access time - so in your case

myaccesstime = timeserial(elapsed\60,mod(elapsed/60),0)

explanation

mod gives remainder of division, so mod(elapsed/60) gives left over minutes eg elapsed of 490 will return 10

\ operator is integer division, ignores remainder so 490\60 gives 8


so timeserial(elapsed\60,mod(elapsed/60),0) with elapsed - 490
should give you a time of 08:10.

hope this helps (and hope it works!)
 
Try something like CDate([lngWholeNumber]/60/24). Be carefull though, the result will include a time AND date.
 

Users who are viewing this thread

Back
Top Bottom