Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

selecting last inserted or updated record from Access table .

Posted on 2002-06-14
3
Medium Priority
?
684 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 200 total points
ID: 7080021
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
ID: 7080151
isilver, your comment gives the last inserted record, but how to get last updated record???
0
 

Author Comment

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

773 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