How can I Return Just One Row With a Query?

B

Brad

I would like to have a query return just the last row added to a table.

I can sort the table to ensure that the first row retrieved is the row that
I want.

I just can’t see an easy way to limit the query to this one row.

Thanks,
Brad
 
J

Jerry Whittle

What are you sorting on? Sort on that in a query in descending order. Next go
to SQL view and change SELECT to SELECT TOP 1.

There is a small problem that if there is a tie, all the tied records will
be returned.
 
B

Brad

Jerry,

Thanks for the quick response.

I did a little test and the "Top 1" will work nicely.

I appreciate your help.

Brad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top