Query question

seirra

Board Regular
Joined
Nov 7, 2002
Messages
72
I am trying to find a way of setting up a query that will only show that last entry. This would be based on the auto number. I was wondering if anyone knew away to do this
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Select the Sigma icon in the Toolbar (looks like the letter "E"). Select your Autonumber field. By default, you will see Group By in the Totals column. Change Group By to Max. This will give you your Max Autonum. Save this query. Write a new query, using your original table and the query that you just wrote. Tie(Inner Join) the query and the table together on the Max Autonum field. Select whichever fields that you want to see. This query will only return one row: the record with the Max Autonum.

*edit* you can actually do this within one query by using a subquery in the WHERE clause of your Autonum field, but I don't know your SQL experience. Plus, it'll be slower as subqueries are not pre-compiled by Jet as nested queries are.
 
Upvote 0

Forum statistics

Threads
1,221,596
Messages
6,160,716
Members
451,665
Latest member
PierreF

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top