Export first 100 records from a table into Excel

Hello,
I have created a table which is created from 2 append queries. I have indexed the table so field 'Total'
is in descending order. Will this stay in descending order all the time now?

My query is the table contains 22,000 entries and I only want the top 100 exported to Excel.
Is it possible to loop through the table to only paste the first 100 entries to Excel and forget
the rest?

Thanks
Ian
ShockUKAsked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
Ian,

Create the query below, and export the query to Excel:

SELECT TOP 100 *
FROM SomeTable
ORDER BY Total DESC

Always use an ORDER BY clause if you need your results ordered in some way, because there is nothing
magical in the way records are physical ordered in memory.
0
 
Rey Obrero (Capricorn1)Commented:
you can get the top 100  using a query
the order by will determine which 100  you want to get

select top 100 *
from TableX
order by [fieldName]
0
 
Rey Obrero (Capricorn1)Commented:
(Will this stay in descending order all the time now?)
may or may not, but that is irrelevant . You can always sort them using a query.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.