First 200 Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a query that will take the first 200 records that fit the parameters
(or, any 200, as long as they meet the query parameters and we do not get
more than 200). I do not know SQL, so I need something I can do in query
builder. Can anyone help??
--
Regards,

Bryan Brassell
Padgett Business Services
281-897-9141
 
Open the query in design view. Click on the icon bar in the icon that
reads"All" and type in 200 and then press ENTER.

Run your query.
 
I tried this and it gave me 201 records. I am dumbfounded as to why.
--
Regards,

Bryan Brassell
Padgett Business Services
281-897-9141
 
I figured out why i got 201 records - the last two in the list are the same
number (using a "total owed" field). If no. 201 is the same as no. 200, it
pulls them both. How do I get it to stop at 200?
--
Regards,

Bryan Brassell
Padgett Business Services
281-897-9141
 
Dear Bryan:

It chooses rows to display according to their sort order. Choose a unique
sort order. Then there won't be any ties.

Tom Ellison
 
Set the MaxRecords value to 200.

In fact,
(or, any 200, as long as they meet the query parameters and

Only set the MaxRecords value to 200.

It depends what you want. Selecting the Top 200 sorts and
chooses, which is slow, but deterministic.

Setting the MaxRecords value just changes the number of records
access gets, which is faster, but does not flow through into
nested queries.

(david)
 
To expand on Tom's suggestion.
As the last Sort category use the primary key of the table(s) involved.
Using that technique should always give you the exact number of records you
want returned.
 
Back
Top