query

  • Thread starter Thread starter Test
  • Start date Start date
T

Test

Hi!
I'm new to access and perhaps this is pretty basic.
I need a query to return the last row of the table. How
can this be achieved?
Thanks in advance!
 
Access tables don't have a "last" row. Records are like school children on a
playground. There is no order. Only after the bell rings and the students
get in line by classroom and alphabetical is one child last in line.
 
Ok, understood; let's say that in that table there's an
autonumber column and what I need is to get the larger or
last value of that column; that would be the "last child
in line". Please help me!!
I guess there should be some clause like "Last", "Max" or
something like that to be included in the sql query.
Thanks in advance,
 
You could do this with a subquery.

SELECT FieldA, FieldB, ...
FROM TableA
WHERE SomeField =
(SELECT Max(tmp.Somefield)
FROM TableA as Tmp)
 
Back
Top