Pace Per Mile help (1 Viewer)

LHolden

Registered User.
Local time
Today, 13:34
Joined
Jul 18, 2012
Messages
73
Hi all,

I've been trying to put together a running database for myself and I'm currently a little stuck. I'm trying to get a query out that will display my distance, time, and time per mile for my runs. The distance (in miles) and time (mm:ss) are easy because they are being pulled straight from the table. However, the pace per mile is giving me some trouble. I'm trying to find the easiest way to tell access to basically divide distance/time, and I assume I have to convert the mm:ss to either a decimal value for minutes, or to seconds, and then back to mm:ss. Any help would be greatly appreciated.
 

David R

I know a few things...
Local time
Today, 12:34
Joined
Oct 23, 2001
Messages
2,633
Funny, I had to do this in my Running Google Doc recently... :p

I'm going to proceed as if your [RunTime] field is text... please advise if that's untrue.

If you're pretty sure you won't be running over 59:59 anytime soon, the calculation is pretty simple:
Code:
RawTime: Val(Left([RunTime],2))*60+Val(Right([RunTime],2))
will give you the time in raw seconds.

Code:
RawPace: [RawTime]/[RunLength]
is your pace, of course, but in seconds which isn't terribly useful.

Code:
FormattedPace: Format(Int([RawPace]/60),"00") & ":" & Format([RawPace] Mod 60,"00")
 

LHolden

Registered User.
Local time
Today, 13:34
Joined
Jul 18, 2012
Messages
73
That's fantastic, thank you! I don't think I'll be running over an hour any time soon, but if/when I do, would it be easier to use hh:mm:ss or continue with mm:ss for pace calculations?
 

David R

I know a few things...
Local time
Today, 12:34
Joined
Oct 23, 2001
Messages
2,633
That's true, since these aren't real Date/Time fields it won't care if you write it as 89:33 for a while.

Alternatively you can rewrite step 1 and step 3 to parse it for hours as well... the logic is similar.
 

Users who are viewing this thread

Top Bottom