First and last records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I work in a warehouse. We have aisles (i.e. AA, BB, 1A, AF) and in each aisle there are pick slots (4 digit). I have an Access table containing all of the pick slots and would like to find a way to return the first and last slot in each aisle. Can someone help me?
 
Dan said:
I work in a warehouse. We have aisles (i.e. AA, BB, 1A, AF) and in each aisle
there are pick slots (4 digit). I have an Access table containing all of the
pick slots and would like to find a way to return the first and last slot in
each aisle. Can someone help me?

First off I would suggest shifting your thinking from First/Last to Min/Max.
While there are functions in Access for First() and Last() they don't often work
as expected and are generally useless. If your 4 digit pick slots are
sequential where the first one in the aisle also has the lowest number then you
should be able to use a query similar to...


SELECT aisle, Min(slot) AS FirstSlot, Max(slot) AS LastSlot
FROM YourTableName
GROUP BY aisle
 
Back
Top