473,385 Members | 1,753 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,385 software developers and data experts.

seeking query advice

I'm rephrasing an earlier post. From my tables I have managed to get
track results into one table. I have runners with race times from
different meets. One runner has compteted in 15 meets and a second
runner in seven. How can I compare their averages for the five meets
they competed against one another. I also want to make other, similar
1-to-1 comparisons.

Thank you.

Mar 16 '07 #1
2 1199
Without having an example of your table structure, I'm going to step
out on a very thin limb and assume that your database is well
designed.

tbl_runner:
runner_id
runner_name
etc.

tbl_location:
location_id
location_name

tbl_race:
race_id
location_id
race_date

tbl_run_race:
run_race_id
runner_id
race_id
run_race_time

A query to get each runner average would be:
SELECT R.runner_name,
R.runner_id,
avg(RR.run_race_time) AS avg_time
FROM tbl_runner AS R
INNER JOIN tbl_run_race AS RR
ON R.runner_id = RR.runner_id
GROUP BY R.runner_name
R.runner_id
ORDER BY R.runner_name ASC

Then if you had a subform on your form that was based on this query,
then you could use two combo boxes on the main form to create a
dynamic filter of this recordset using the afterupdate event of the
combo boxes.

Cheers,
Jason Lepack

On Mar 16, 9:30 am, "santoni" <santon...@gmail.comwrote:
I'm rephrasing an earlier post. From my tables I have managed to get
track results into one table. I have runners with race times from
different meets. One runner has compteted in 15 meets and a second
runner in seven. How can I compare their averages for the five meets
they competed against one another. I also want to make other, similar
1-to-1 comparisons.

Thank you.

Mar 16 '07 #2
On 16 Mar 2007 06:30:09 -0700, "santoni" <sa*******@gmail.comwrote:

OK, I envision a table tblRaces like this:

MeetID RunnerID RaceTime
1 1000 123.5
1 1001 124.6
1 1002 124.7
1 1003 124.8
2 1001 130.1
2 1002 128.6
2 1004 127.9
3 1001 123.4

Then to compare two runners (in this case 1001 and 1002), I create 3
queries:
qryMeets_1001:
SELECT tblRaces.MeetID, tblRaces.RunnerID, tblRaces.RaceTime
FROM tblRaces
WHERE (((tblRaces.RunnerID)=1001));

qryMeets_1002:
SELECT tblRaces.MeetID, tblRaces.RunnerID, tblRaces.RaceTime
FROM tblRaces
WHERE (((tblRaces.RunnerID)=1002));

And finally to get the data about the races they both ran in:
SELECT qryMeets_1001.MeetID, qryMeets_1001.RunnerID,
qryMeets_1002.RunnerID, qryMeets_1001.RaceTime, qryMeets_1002.RaceTime
FROM qryMeets_1001 INNER JOIN qryMeets_1002 ON qryMeets_1001.MeetID =
qryMeets_1002.MeetID;

Using this query, you can perform your analysis, for example
calculating the Avg(RaceTime) or the time for 1001 minus the time for
1002.

-Tom.

>I'm rephrasing an earlier post. From my tables I have managed to get
track results into one table. I have runners with race times from
different meets. One runner has compteted in 15 meets and a second
runner in seven. How can I compare their averages for the five meets
they competed against one another. I also want to make other, similar
1-to-1 comparisons.

Thank you.
Mar 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: James Turner | last post by:
I am trying to store formatted text (windows format) into a MySQL database and then retrieve it. The field in the database is a varchar. I cut and paste the test into a form field formatted, then...
3
by: dlesandrini | last post by:
I need advice about my decision to go with Replication in general. This post was placed on the Microsoft Replication newsgroup, but I really value the feedback that comes from this group as well. ...
1
by: Ryan Case | last post by:
I am using Access to store data from a CAD program. We then in turn have another program pull data from Access to drive computerized saws. In order to get the data from the CAD program to Access, a...
2
by: Joseph Geretz | last post by:
I don't know if this is the right group for my question, but I'm seeking advice from knowledgable .NET developers. Hopefully I've come to the right place. I work with a document management...
3
by: bill | last post by:
I am using VS2005 to build a web form dynamically. I'm using AddHandler to connect a custom event handler to the TextChanged event of dynamically added textbox controls. Data entered in the...
4
by: Jerry | last post by:
Hello! I'm creating an application where users can enter their hours worked on certain projects and have them saved to a database. Right now there are about 60 different projects and that number...
7
by: Joseph Geretz | last post by:
I have a Service which runs OK, but I'm abviously not starting it properly. In my OnStart event I commence a long running process which polls a database table and performs various processing. Since...
3
by: Kevin Walzer | last post by:
Hello, I am seeking to update this wiki page, which lists Mac OS X applications using Python in a significant way: http://wiki.python.org/moin/MacPython/MacSoftwareUsingPython This query is...
3
by: Jia Lu | last post by:
Hello all I see there are lots of flat db or db-like modules in the standard python modules. What about the keywords seeking speed of them ? (I want to put about 10000 articles with 10000...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.