Solved

How query only the THREE most recent records in a table

Posted on 2013-12-06
4
323 Views
Last Modified: 2013-12-06
I am using query designer to attempt to select only the most recent THREE records in a table.  

Can this be done?
0
Comment
Question by:SteveL13
  • 2
  • 2
4 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39701825
if you have an autonumber field this will do it

select top 3 * from TableName
Order by [autonumberfield name] desc
0
 

Author Comment

by:SteveL13
ID: 39701849
Once again I didn't explain the challenge very well.

I need to select the most recent three records from tblOpenOrders where Part_No = Forms!frmOpenOrders!txtPart_No

What should the SQL be for this?
0
 

Author Comment

by:SteveL13
ID: 39701852
And the records in tblOpenOrders do have an autonumber record ID number.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39701871
try this

select top 3 * from  tblOpenOrders
where tblOpenOrders.Part_No = Forms!frmOpenOrders!txtPart_No
Order by [record ID] desc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 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

22 Experts available now in Live!

Get 1:1 Help Now