How to find out the last inserted row in Access

R

R

Make a query and pull in the table. Pull a field, like ID from the table
into the grid. Select View/Totals.

Down in the grid, under "Total" row, change "Group By" to "Count".

Run query. Will tell you how many records in the table.

SQL:

SELECT Count(tablename.ID) AS CountOfID
FROM tablename;
 
J

John Vinson

Hi,
I want to find out the last inserted row in Access.How
to go about

If you are assuming that Access keeps track of which row was most
recently inserted, you are out of luck. IT DOESN'T. You must - no
option! - keep track of that yourself, either by using a timestamp
field with a default value of Now() - from which you can use a query
selecting the maximum value - or by using a Custom Counter field which
increments for each record.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top