473,947 Members | 26,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Distanc eTraveled, Running.[TimeExercised-Hours],
Running.[TimeExercised-Minutes], Running.[TimeExercised-Seconds],
((([TimeExercised-Hours]*3600)+([TimeExercised-Minutes]*60)+[TimeExercised-S
econds])/60)/[DistanceTravele d] 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 1996
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.607142857 142857142857142 8571429

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******@c lear.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.Distanc eTraveled, Running.[TimeExercised-Hours],
Running.[TimeExercised-Minutes], Running.[TimeExercised-Seconds],
((([TimeExercised-Hours]*3600)+([TimeExercised-Minutes]*60)+[TimeExercised-S econds])/60)/[DistanceTravele d] 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******@c lear.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.Distanc eTraveled, Running.[TimeExercised-Hours],
Running.[TimeExercised-Minutes],
Running.[TimeExercised-Seconds],
((([TimeExercised-Hours]*3600)+([TimeExercised-Minutes]*60)+[Ti
meExercised-S econds])/60)/[DistanceTravele d] 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******@gener ation.net> wrote in message
news:b5******** *************** *******@news.te ranews.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******** *********@newss vr22.news.prodi gy.com:
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.hundred s.

This should do it:

Int(((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+
[TimeExercised-Seconds])/60)/[DistanceTravell ed])+
((((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+
[TimeExercised-Seconds])/60)/[DistanceTravell ed])-Int
(((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+
[TimeExercised-Seconds])/60)/[DistanceTravell ed]))*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******@gener ation.net> wrote in message
news:a1******** *************** *******@news.te ranews.com...
"Wayne Morgan" <co************ *************** @hotmail.com> wrote
in news:bP******** *********@newss vr22.news.prodi gy.com:
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.hundred s.

This should do it:

Int(((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+
[TimeExercised-Seconds])/60)/[DistanceTravell ed])+
((((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+
[TimeExercised-Seconds])/60)/[DistanceTravell ed])-Int
(((([TimeExercised-Hours]*3600)+([TimeExercised-minutes]*60)+
[TimeExercised-Seconds])/60)/[DistanceTravell ed]))*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******@c lear.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
4030
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 than the one I think he will provide. The test data, A:\\"514650.txt", appears at the end of the program. The problem is that the program won't read this file and the debugger as far as i know how to work it won't point out the mistake of any....
1
1647
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 subject A. This contains some fairly complex calculations. My problem is that I need to produce a report that shows the scores for all candidates regardless of whether they sat the exam for subject A. This should be fairly easy to produce: simply...
3
6522
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 criteria, the Mid function returns the values when I run the query. So if one of the values is a "t" (no quotes), can I not ask to isolate that record by putting "t" as a criteria? Nope - error, error. If I put it within the expression itself...
0
2004
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 directory property cannot be found in the cache" when calling SetSecurityDescriptor. Any suggestions? ADSSECURITYLib.ADsSecurity pSEC = new ADsSecurity(); ActiveDs.IADsSecurityDescriptor pSD = (ActiveDs.IADsSecurityDescriptor...
4
3771
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 calculation is very simple. The calculation is done in an underling query if I can call it a query or I should call it a SQL statement. It looks like a query but it is not saved as the query. The calculation in that query is very simple - ExtendedPrice:*....
10
3814
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 where the number of ways of failure (pFal) is calculated Both errors happen in the code section x1 = Draw - MatchesReq x2 = Field - Selections For Counter = 1 To (Draw - MatchesReq - 1) x1 = x1 * (Draw - MatchesReq - Counter)
9
2151
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 elements. Try simplifying the expression by assigning parts of the expression to variables. I'm guessing that one of these calcs is the problem: (/)*31 AS , (/)*31 AS , (/)*31 AS , / AS
11
2459
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 the point is at the end of the program. //week 6 Inventory3 // by Tina Jones // IT 215 // october 07/2007
6
11479
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 at once.) I recorded a macro to get the code, which I tweaked minimally, and pasted into a clean spreadsheet to test it. It seems to work beautifully. However, when I try to apply the same code within a larger programme, in a working spreadsheet,...
0
9985
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11173
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9895
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8256
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4540
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3544
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.