View Single Post
  #6  
Old May 27th, 2010, 12:18 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default First and Last Problem

How can you claim with authority that they are not good if you are not even
sure about how they should work in the first place?

Min and Max can replace First and Last if there is just one field aggregated
with First, or Last, but not if there is more than a single field so
aggregated. How could you replace FIRST in the following query, with MIN /
MAX:

SELECT f1, FIRST(f2), FIRST(f3) FROM table GROUP BY f1

where the goal of that statement is to get a (one) record, for each group
value.
Considering the data:

f1 f2 f3
10 1 50
10 1 50
10 50 1
10 100 50
10 50 100
10 50 1
10 50 100


(just for illustration, but someone should not think that this data
represent all possibilities).

And come with a simple, or not, solution, implying MIN (or MAX)... or change
your claim about FIRST/LAST "shouldn't even be an option to use".



Vanderghast, Access MVP


"ghetto_banjo" wrote in message
...
First and Last do NOT work the way they think you do. I believe they
try to see the first and last records written to disk or something,
but the results are NEVER good. They shouldn't even be an option to
use in Access.


Instead, use Min and Max, they will work in the manner you would
expect.