Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit Recordset? 1

Status
Not open for further replies.

eclipse33

Programmer
Apr 13, 2001
94
CA
Hi

Is there a way to set up a query so that it returns only the first record that satisifies the criteria??

I have a database with approx 50 000 records...on the server...with 10 workstations accessing it at the same time.

The Form's recordsource is set with the query &quot;SELECT * FROM tblClients WHERE called <> TRUE&quot;

But this will return maybe 30 000 records to the recordset...

Is there a way to just return the first record where called <> True???

Thanks in advance
eclipse33
 
Hi!

Include Top 1:

&quot;SELECT Top 1 * FROM tblClients WHERE called <> TRUE&quot;

You will probably want to include some order by clause to make sure the correct record is on top.

hth
Jeff Bridgham
bridgham@purdue.edu
 
If you leave out the order by clause...what records will it take?
 
Hi!

It should take the top 1 as it is ordered in the table. If you wuery works on multiple tables, then I am not sure how Access decides to sort the records lacking an order by clause. I would think that in the multiple table case it is better to tell Access what to do then to assume anything.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top