B
bkimbrell
I am trying to select the fastest times from a table Races where the PK
is made up on several fields such as:
Track
RaceDate
RaceNumber
The Races table contains fields that need to be grouped including:
Surface
Distance
And the field that I want to select is:
WinningTime - I believe that I want the Min(WinningTime)
The child table to Races is called Starts and has the same primary key
with one addition:
Track
RaceDate
RaceNumber
HorseName
I need to select the minimum WinningTime for each group of Surface &
Distance and then go to the starts table to get the HorseNames for each
of those combinations.
I see examples of using a Sub Query with a single primary key such as
the Northwind example of finding the max(OrderDate) for each customer
and then using that to get additional information, but I cannot get
this to work with my multi-field PK.
If I use the View - Totals option, I cannot specify RaceDate,
RaceNumber since this forces them to be "Grouped" and returns every
RaceDate and RaceNumber combination.
How do I find each unique Surface & Distance WinningTime while
returning information from the child table such as HorseName, RaceDate,
RaceNumber, etc?
is made up on several fields such as:
Track
RaceDate
RaceNumber
The Races table contains fields that need to be grouped including:
Surface
Distance
And the field that I want to select is:
WinningTime - I believe that I want the Min(WinningTime)
The child table to Races is called Starts and has the same primary key
with one addition:
Track
RaceDate
RaceNumber
HorseName
I need to select the minimum WinningTime for each group of Surface &
Distance and then go to the starts table to get the HorseNames for each
of those combinations.
I see examples of using a Sub Query with a single primary key such as
the Northwind example of finding the max(OrderDate) for each customer
and then using that to get additional information, but I cannot get
this to work with my multi-field PK.
If I use the View - Totals option, I cannot specify RaceDate,
RaceNumber since this forces them to be "Grouped" and returns every
RaceDate and RaceNumber combination.
How do I find each unique Surface & Distance WinningTime while
returning information from the child table such as HorseName, RaceDate,
RaceNumber, etc?