Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First & Last in aggregate function 2

Status
Not open for further replies.

Pampers

Technical User
Apr 7, 2004
1,300
AN
Hi folks,
Can anyone explain what First and Last means in the aggregate function in a mdb-query?

Pampers [afro]
There is only one way to change a diaper - fast
 
They are supposed to return the first and last value of the field for each group, but I personally never see them working reliably ...
So, the short answer is: forget it.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV

They do work ... it's just that the meaning of "First" or "Last" aren't what intuitively make sense. To me they should mean that "First" will return the value on the first displayed record and similarly, "Last" should be the value on the last displayed record. (Analagous definitions for grouped records)

What they appear to mean however is "first or last retrieved from the source". Where the record containing the First or Last value actually ends up in the result is dictated by Order By or default sort ordering rules so it may not (probably won't) appear as the "First" or "Last" record.
 
Tnx for the replies,
The reason for asking was indeed that the outcome of Last and First resulted in a no so predictable resultset... Leaving them out seems like a safe thing to do. But Golom, tnx for the info.

Pampers [afro]
There is only one way to change a diaper - fast
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top