J
justme
I'm not completely clear on the intricacies of totals queries. I have a
bunch of fields from one table. I want to filter them down to ANY ONE RECORD
with the LATEST EventDate of the BIGGEST FitID number for EACH Style (style
is distinct).
Essentially, I want to just tell the query to find
-ONE record for each STYLE
- with the biggest fitID number
- Then, if there are multiple records with the same FitID number
- find the record with the latest date
- And if there are still multiple records with that latest date, then
- choose ANY one of those records
(I really don't want to aggregate the rest of the fields)
I made a totals query in design view that has
StyleID | FitID | EventDate | EventType | EventStatus
GroupBy: Style
Max: FitID
Max:EventDate
First: EventType
First: EventStatus
First: etc......
However, the information in the columns seem mismatched. Is it grabbing
information for each column, independently of another?
Any aggregate functions I try instead of "First" for the remaining columns
changes the total number of records returned.
The only way I know how to get what I want is to do an aggregate query for
just the first three columns, then do another query on that query, adding the
matching information in the rest of the fields. Is that correct?
Is there any way to do it all in one swoop? How can I get what I am after?
Mucho thanks.
bunch of fields from one table. I want to filter them down to ANY ONE RECORD
with the LATEST EventDate of the BIGGEST FitID number for EACH Style (style
is distinct).
Essentially, I want to just tell the query to find
-ONE record for each STYLE
- with the biggest fitID number
- Then, if there are multiple records with the same FitID number
- find the record with the latest date
- And if there are still multiple records with that latest date, then
- choose ANY one of those records
(I really don't want to aggregate the rest of the fields)
I made a totals query in design view that has
StyleID | FitID | EventDate | EventType | EventStatus
GroupBy: Style
Max: FitID
Max:EventDate
First: EventType
First: EventStatus
First: etc......
However, the information in the columns seem mismatched. Is it grabbing
information for each column, independently of another?
Any aggregate functions I try instead of "First" for the remaining columns
changes the total number of records returned.
The only way I know how to get what I want is to do an aggregate query for
just the first three columns, then do another query on that query, adding the
matching information in the rest of the fields. Is that correct?
Is there any way to do it all in one swoop? How can I get what I am after?
Mucho thanks.