?
Solved

How query only the THREE most recent records in a table

Posted on 2013-12-06
4
Medium Priority
?
336 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
[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
  • 2
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 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