Re: How to find latest date/time in grouped rows
- From: Dorian <Dorian@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 9 Jan 2009 10:10:01 -0800
That wont do it...probably because I explained the problem poorly.
The id is not unique and I need the id, team and date where the date is the
latest date for the id. E.G.
1 TeamA 1/1/2009 -- gets chosen
1 TeamB 12/25/2008
2 TeamA 1/1/2008
2 TeamC 1/1/2009 -- gets chosen
essentially I'm looking for the last team assigned to a problem(id).
so I definitely think there has to be a 'group by' somewhere.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
"Marshall Barton" wrote:
Dorian wrote:.
I have a table with id, team, date
I need to select the id and team with the latest date
team can appear multiple times.
I tried SELECT ID, TEAM, MAX(DATE) GROUP BY ID but then it expects TEAM to
have an aggregate function. I just need the team on the record with the
latest date.
SELECT ID, TEAM, [DATE]
FROM table
WHERE [DATE] = (SELECT Max(X.DATE])
FROM table As X)
--
Marsh
MVP [MS Access]
- Follow-Ups:
- Re: How to find latest date/time in grouped rows
- From: Marshall Barton
- Re: How to find latest date/time in grouped rows
- From: John Spencer (MVP)
- Re: How to find latest date/time in grouped rows
- References:
- How to find latest date/time in grouped rows
- From: Dorian
- Re: How to find latest date/time in grouped rows
- From: Marshall Barton
- How to find latest date/time in grouped rows
- Prev by Date: Query Based on Another Query
- Next by Date: RE: Query Based on Another Query
- Previous by thread: Re: How to find latest date/time in grouped rows
- Next by thread: Re: How to find latest date/time in grouped rows
- Index(es):
Relevant Pages
|