434,720 Members | 2,095 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

# Error in Pace Calculation

 P: n/a Hi, Hoping someone can help. I've designed a running database Access 2003 but am having trouble with the pace calculation. I've googled and searched the usual suspects but it doesn't give the answer or it gives me the same answer as below. Here's how it works(or doesn't!) SELECT Running.ID, Running.[Workout Date], Running.Course, Running.DistanceTraveled, Running.[TimeExercised-Hours], Running.[TimeExercised-Minutes], Running.[TimeExercised-Seconds], ((([TimeExercised-Hours]*3600)+([TimeExercised-Minutes]*60)+[TimeExercised-S econds])/60)/[DistanceTraveled] AS Pace, Running.Notes FROM Running; Here's the problem 1.4Km Distance 10minutes 39 Seconds gives a pace of 7.60 when it should be 7.36. Obviously, the simple answer would be to multiply the numbers after the decimal by 6. 1) How do you do that? 2) Is there an easier way? Any help greatly appreciated. -- SharkSYA Nov 12 '05 #1
6 Replies

 P: n/a Let's see. Using your equation I would get 0*3600+10*60+39 for a total of 639 639/60=10.65 10.65/1.4=7.6071428571428571428571428571429 I just did it manually as well and come out with the same thing. -- Wayne Morgan MS Access MVP "SharkSYA" wrote in message news:3f******@clear.net.nz... Hi, Hoping someone can help. I've designed a running database Access 2003 but am having trouble with the pace calculation. I've googled and searched the usual suspects but it doesn't give the answer or it gives me the same answer as below. Here's how it works(or doesn't!) SELECT Running.ID, Running.[Workout Date], Running.Course, Running.DistanceTraveled, Running.[TimeExercised-Hours], Running.[TimeExercised-Minutes], Running.[TimeExercised-Seconds], ((([TimeExercised-Hours]*3600)+([TimeExercised-Minutes]*60)+[TimeExercised-S econds])/60)/[DistanceTraveled] AS Pace, Running.Notes FROM Running; Here's the problem 1.4Km Distance 10minutes 39 Seconds gives a pace of 7.60 when it should be 7.36. Obviously, the simple answer would be to multiply the numbers after the decimal by 6. 1) How do you do that? 2) Is there an easier way? Any help greatly appreciated. -- SharkSYA Nov 12 '05 #2

 P: n/a To add to the confusion: To me, pace means Km/h We have Km/s, divide 1.4 Km by 639 seconds, then multiply by the number of seconds in 1 hour. This gives me 7.88. Bob Quintal "SharkSYA" wrote in news:3f******@clear.net.nz: Hi, Hoping someone can help. I've designed a running database Access 2003 but am having trouble with the pace calculation. I've googled and searched the usual suspects but it doesn't give the answer or it gives me the same answer as below. Here's how it works(or doesn't!) SELECT Running.ID, Running.[Workout Date], Running.Course, Running.DistanceTraveled, Running.[TimeExercised-Hours], Running.[TimeExercised-Minutes], Running.[TimeExercised-Seconds], ((([TimeExercised-Hours]*3600)+([TimeExercised-Minutes]*60)+[Ti meExercised-S econds])/60)/[DistanceTraveled] AS Pace, Running.Notes FROM Running; Here's the problem 1.4Km Distance 10minutes 39 Seconds gives a pace of 7.60 when it should be 7.36. Obviously, the simple answer would be to multiply the numbers after the decimal by 6. 1) How do you do that? 2) Is there an easier way? Any help greatly appreciated. -- SharkSYA Nov 12 '05 #3

 P: n/a Your equation is correct for Km/Hr. However, SharkSYA is dividing the other way over and is getting Minutes/Kilometer. -- Wayne Morgan MS Access MVP "Bob Quintal" wrote in message news:b5******************************@news.teranew s.com... To add to the confusion: To me, pace means Km/h We have Km/s, divide 1.4 Km by 639 seconds, then multiply by the number of seconds in 1 hour. This gives me 7.88. Nov 12 '05 #4

 P: n/a "Wayne Morgan" wrote in news:bP*****************@newssvr22.news.prodigy.co m: Your equation is correct for Km/Hr. However, SharkSYA is dividing the other way over and is getting Minutes/Kilometer. So his wanted format is be minutes:seconds not minutes.hundreds. This should do it: Int(((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+ [TimeExercised-Seconds])/60)/[DistanceTravelled])+ ((((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+ [TimeExercised-Seconds])/60)/[DistanceTravelled])-Int (((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+ [TimeExercised-Seconds])/60)/[DistanceTravelled]))*0.6 AS pace However, I suggest that creating the calc as an user designed function may be the way to go. Public Function pacex(dist As Single, hours As Integer, min As Integer, sec As Integer) As Single 'calculates the pace as minutes/kilometer Dim pacedec As Single Dim minx As Single, secx As Single pacedec = (hours * 3600 + min * 60 + sec) / 60 / dist minx = Int(pacedec) secx = (pacedec - minx) * 0.6 pacex = minx + secx End Function Bob Q. Nov 12 '05 #5

 P: n/a "Bob Quintal" wrote in message news:a1******************************@news.teranew s.com... "Wayne Morgan" wrote in news:bP*****************@newssvr22.news.prodigy.co m: Your equation is correct for Km/Hr. However, SharkSYA is dividing the other way over and is getting Minutes/Kilometer. So his wanted format is be minutes:seconds not minutes.hundreds. This should do it: Int(((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+ [TimeExercised-Seconds])/60)/[DistanceTravelled])+ ((((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+ [TimeExercised-Seconds])/60)/[DistanceTravelled])-Int (((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+ [TimeExercised-Seconds])/60)/[DistanceTravelled]))*0.6 AS pace However, I suggest that creating the calc as an user designed function may be the way to go. Public Function pacex(dist As Single, hours As Integer, min As Integer, sec As Integer) As Single 'calculates the pace as minutes/kilometer Dim pacedec As Single Dim minx As Single, secx As Single pacedec = (hours * 3600 + min * 60 + sec) / 60 / dist minx = Int(pacedec) secx = (pacedec - minx) * 0.6 pacex = minx + secx End Function Hi Bob, Your blood's worth bottling! Better this year than last. Thanks mate, -- SharkSYA Bob Q. Nov 12 '05 #6

 P: n/a "SharkSYA" wrote in news:3f******@clear.net.nz: However, I suggest that creating the calc as an user designed function may be the way to go. Public Function pacex(dist As Single, hours As Integer, min As Integer, sec As Integer) As Single 'calculates the pace as minutes.seconds/kilometer Dim pacedec As Single Dim minx As Single, secx As Single pacedec = (hours * 3600 + min * 60 + sec) / 60 / dist minx = Int(pacedec) secx = (pacedec - minx) * 0.6 pacex = minx + secx End Function Hi Bob, Your blood's worth bottling! Better this year than last. Thanks mate, No, there's not enough alcohol in my blood to make it worth bottling. :) Bob Q. Nov 12 '05 #7

### This discussion thread is closed

Replies have been disabled for this discussion.