G
Guest
I'm trying to construct a track meet database. I have 5 tables: tblMeet
(fields are MeetID, MeetDate, Event); tblEventDetail (fields are
EventDetailID, fkParticipant, fkMeetID, Minutes, Seconds, Feet, Inches);
tblEventLookup (fields are Event, Type, Type2); tblParticipants (fields are
Name, School, Gender); and tblSchoolLookup (field is School).
Field events will have "distance" results (feet, inches) and Track events
will have "time" results (minutes, seconds). Currently I'm converting Track
times as such: Time: (Nz([Minutes]*60)*100)+Nz([Seconds]*100). Fields
events are converted as: Distance: (Nz([Feet]*12)*10)+Nz([Inches]*10).
First question: do you see any problem in my structure so far? Any
suggestions?
Second question: should I keep re-entering these formulas on each form,
report, query, etc, or can I store calculations like this in a module?
Third question: I'll want to rank these records and assign a point value
based on the rank. I set up 2 queries to do this because in Track events the
lowest result wins, and in Field events the highest wins. I can get the
ranking to work, but I can't get a report to work based on either query.
Here's an example:
SELECT qryDistance1.EventDetailID, qryDistance1.MeetDate,
qryDistance1.fkParticipant, qryDistance1.Type, qryDistance1.School,
qryDistance1.Event, qryDistance1.Distance, (Select Count(*) from qryDistance
Where [Distance]+1 > qryDistance1.[Distance]
AS DistanceRank
FROM qryDistance AS qryDistance1
ORDER BY qryDistance1.Distance DESC;
I get the "multi level group by clause is not allowed in a subquery" error,
because I'm trying to group the results on MeetDate and then Event.
If I can get this to work, then how can I combine my Time and Distance
queries as the basis for a report without the dreaded cartesian product?
Thanks for your time.
(fields are MeetID, MeetDate, Event); tblEventDetail (fields are
EventDetailID, fkParticipant, fkMeetID, Minutes, Seconds, Feet, Inches);
tblEventLookup (fields are Event, Type, Type2); tblParticipants (fields are
Name, School, Gender); and tblSchoolLookup (field is School).
Field events will have "distance" results (feet, inches) and Track events
will have "time" results (minutes, seconds). Currently I'm converting Track
times as such: Time: (Nz([Minutes]*60)*100)+Nz([Seconds]*100). Fields
events are converted as: Distance: (Nz([Feet]*12)*10)+Nz([Inches]*10).
First question: do you see any problem in my structure so far? Any
suggestions?
Second question: should I keep re-entering these formulas on each form,
report, query, etc, or can I store calculations like this in a module?
Third question: I'll want to rank these records and assign a point value
based on the rank. I set up 2 queries to do this because in Track events the
lowest result wins, and in Field events the highest wins. I can get the
ranking to work, but I can't get a report to work based on either query.
Here's an example:
SELECT qryDistance1.EventDetailID, qryDistance1.MeetDate,
qryDistance1.fkParticipant, qryDistance1.Type, qryDistance1.School,
qryDistance1.Event, qryDistance1.Distance, (Select Count(*) from qryDistance
Where [Distance]+1 > qryDistance1.[Distance]
![Wink ;) ;)](/styles/default/custom/smilies/wink.gif)
FROM qryDistance AS qryDistance1
ORDER BY qryDistance1.Distance DESC;
I get the "multi level group by clause is not allowed in a subquery" error,
because I'm trying to group the results on MeetDate and then Event.
If I can get this to work, then how can I combine my Time and Distance
queries as the basis for a report without the dreaded cartesian product?
Thanks for your time.