Query first record from each group

Cliff

Registered User.
Local time
Today, 15:40
Joined
Dec 2, 2008
Messages
18
I am doing a Biggest Loser challenge at work and have a nice report that shows the users their weight loss over time. I'd also like to add a table that shows the group's starting weight and the group's current weight.

I have one simple weights table that lists the ID of the contestant, the date and the weight.

How can I query / sum the first weight from each contestant, and also the last weight? I suspect this is not easy.

I am a relative beginner using Access 2016.

Thanks
 
In a query you can select the first record using the SQL TOP keyword, like . . .
Code:
SELECT [COLOR="Blue"]TOP 1[/COLOR] * FROM Table ORDER BY Field1
To select the last record, reverse the sort order and select the first record . . .
Code:
SELECT [COLOR="Blue"]TOP 1[/COLOR] * FROM Table ORDER BY Field1 [COLOR="Blue"]DESC[/COLOR]
 
No problem, post back if you get stuck.
 

Users who are viewing this thread

Back
Top Bottom