Solved

How query only the THREE most recent records in a table

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

Technology Partners: 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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

733 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