Solved

selecting last inserted or updated record from Access table .

Posted on 2002-06-14
3
667 Views
Last Modified: 2008-03-17
Hello ..
I want by using sql statement to select last iserted or updated record from Access table .
Any Idea ?
0
Comment
Question by:yazan3000
3 Comments
 
LVL 1

Accepted Solution

by:
isilver earned 50 total points
Comment Utility
This works the best if you have a autonumber with the database.  The line is listed below

select * from [table] where [autonumber field] in (select max([autonumber field]) from [table])

[table] - The talble of the record you want to look up.
[autonumber field] - The field that contains the autonumber.  The reason I say to use the autonumber is because the last record that you add will be the largest number.
0
 
LVL 4

Expert Comment

by:ravi_raj123
Comment Utility
isilver, your comment gives the last inserted record, but how to get last updated record???
0
 

Author Comment

by:yazan3000
Comment Utility
Thank's isilver
do you have any idea about last updated record ?
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now