minutes & seconds only

ssh

Registered User.
Local time
Today, 13:16
Joined
May 22, 2002
Messages
49
How to make Access XP understand minutes and seconds only? Like 110:06, not 1:50:06?
 
Suspect you may be mixing 'apples and oranges'.
Does the '1:50:06' in your example represent the
time portion of a date/time field, e.g.:
7/20/02 1:50:06 PM

…or elapsed time, e.g.
starttime = #12:00:00#
endtime = #13:50:06#
x = EndTime - StartTime

Assuming it's elapsed time, here's a little primer
you can work from the debug window.

To see how x is stored by Access as a date time field:
? x
7.64583333333333E-02
or
0.07645833333333

? cdate(x)
1:50:06 AM

? format(x, "hh:mm:ss")
01:50:06

totalhours = Int(CSng(x * 24))
totalminutes = Int(CSng(x * 1440))
totalseconds = Int(CSng(x * 86400))
hours = totalhours Mod 24
minutes = totalminutes Mod 60
Seconds = totalseconds Mod 60
? totalhours
1
? totalminutes
110
? totalseconds
6606
? seconds
6
y = totalminutes & ":" & format(seconds, "00")
? y
110:06

Bottom line-it's going to take some manipulation
to return your hh:mm:ss display in the format
you're looking for.
 
Actually I have a text file containing minutes and seconds only. In conversion Access will report errors, of course (because of mine has totalminutes:seconds only).
 

Users who are viewing this thread

Back
Top Bottom