J
justme
Hi, this is a re-post of a question not fully solved.
The resulting records will NOT have a unique key, which completely throws me
off, and the books just don't discuss this type of stuff in much detail:
I have records from two tables that are related. I would like to filter
tblFits through a totals query.
tblStyles:
StyleID (PK)
sOther1
sOther2
sOther3
etc...
tblFits
StyleID (FK)
FactoryID
EventID
EventDate
EventStatus
fOther1
fOther2
fOther3
etc...
For Each STYLEID I would like to get the ONE record for each FACTORYID with
the greatest EVENTID number and latest EVENTDATE.
Meaning:
1. For each STYLE, if there is more than one Factory ID, then one of each
FACTORYID (long integer) will be chosen. If there are multiples of any
FACTORYID, the greatest EVENTID will be chosen FOR EACH FACTORYID
2. If there are multiples of an EVENTID (long integer) for any one FACTORYID,
the latest EVENTDATE will be chosen
3. If there are multiples of that EVENTDATE,
the smallest EVENTSTATUSID will be chosen
4. If there are multiples of that EVENTSTATUS (long integer),
it really doesn't matter which EVENTSTATUS
(or any of the other fields) is chosen
There are multiple other fields of all data types within each record.
Again, tFits =
STYLE
FACTORYID
EVENTID
EVENTDATE
EVENTSTATUS
fOTHER1
fOTHER2
fOTHER3
ETC...
THANK YOU!!!
The resulting records will NOT have a unique key, which completely throws me
off, and the books just don't discuss this type of stuff in much detail:
I have records from two tables that are related. I would like to filter
tblFits through a totals query.
tblStyles:
StyleID (PK)
sOther1
sOther2
sOther3
etc...
tblFits
StyleID (FK)
FactoryID
EventID
EventDate
EventStatus
fOther1
fOther2
fOther3
etc...
For Each STYLEID I would like to get the ONE record for each FACTORYID with
the greatest EVENTID number and latest EVENTDATE.
Meaning:
1. For each STYLE, if there is more than one Factory ID, then one of each
FACTORYID (long integer) will be chosen. If there are multiples of any
FACTORYID, the greatest EVENTID will be chosen FOR EACH FACTORYID
2. If there are multiples of an EVENTID (long integer) for any one FACTORYID,
the latest EVENTDATE will be chosen
3. If there are multiples of that EVENTDATE,
the smallest EVENTSTATUSID will be chosen
4. If there are multiples of that EVENTSTATUS (long integer),
it really doesn't matter which EVENTSTATUS
(or any of the other fields) is chosen
There are multiple other fields of all data types within each record.
Again, tFits =
STYLE
FACTORYID
EVENTID
EVENTDATE
EVENTSTATUS
fOTHER1
fOTHER2
fOTHER3
ETC...
THANK YOU!!!