473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Error in Pace Calculation

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 1971
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" <sh****@tw.uk> 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
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" <sh****@tw.uk> 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
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" <bq******@generation.net> 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
"Wayne Morgan" <co***************************@hotmail.com> 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

"Bob Quintal" <bq******@generation.net> wrote in message
news:a1******************************@news.teranew s.com...
"Wayne Morgan" <co***************************@hotmail.com> 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
"SharkSYA" <sh****@tw.uk> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
1
by: Andrew Chanter | last post by:
I have an application that produces examination scores. Candidates have a choice of sitting 1 of 2 subjects or both. I have produced a query that gives all the results for candidates that sat...
3
by: martlaco1 | last post by:
Trying to fix a query that (I thought) had worked once upon a time, and I keep getting a Data Type Mismatch error whenever I enter any criteria for an expression using a Mid function. Without the...
0
by: Jeremy Chapman | last post by:
In an asp.net page, I'm creating an exchange account. I've created the account, and tied it to a primary NT account. Now I'm trying to assign permissions to it but I get an error of "The...
4
by: vg-mail | last post by:
Hello all, I have identical design for form and report but I am getting calculation error on form and everything is OK on report. The form and report are build up on SQL statement. The...
10
by: Lisa | last post by:
In translating the formula for calculating lottery odds for various conditions into a Visual Basic Program, I have apparently missed something in that I get errors in the part of the calculation...
9
by: jessicaeatworld | last post by:
Hi, I'm using Access 2003 on Windows XP. My Error: This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated...
11
by: TinaJones095 | last post by:
Hello I am going to give a program that I have done, but I have to modifiy it, but I need help okay can you help ? Here the program I need help to straighten up below: the Java error is right at...
6
by: Lara1 | last post by:
I'm trying to get certain cells to show a hovering alert message when I click on them. (I don't want an error-message style box to pop up, because I'll eventually want it to show for lots of cells...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.