Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

selecting last inserted or updated record from Access table .

Posted on 2002-06-14
3
Medium Priority
?
680 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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/…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

730 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