Solved

How query only the THREE most recent records in a table

Posted on 2013-12-06
4
334 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 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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