limit records in query

D

dsharbaugh

I am using query in excel to pull in data from an Access database. I only
want 20 results, but the option in xls query is not working when I tick it
and select only 20 records to be included. I don't want to limit the records
in Access as the source there is used by other xls queries. Is there
something else I have to do to make the xls query return only 20 records?
 
F

FSt1

hi.
are we talking about microsoft query ie on the menubar...
data>import external data>new database query?

normally, a querry return data that matches some criteria or returns it all.
you can restrick the number of records by adding criteria but i know of no
way to restrict it to 20 and only 20 records. the question would come
up....which 20? based on what selection criteria.

Post back if you have quetions.
regards
FSt1
 
T

Tim Zych

I see what you're saying...you can limit the records in the options, but
they don't follow through to the spreadsheet, only to the GUI. However you
could add your own Top keyword to the SQL. That seems to work.
 
Top