LIMIT syntax

D

Diilb

I really can't find answer to this question and thought I would post
here for an answer...

I was wondering if there is a LIMIT syntax associated with the SELECT
clause... under Access ?

Thanks for any response.

Diilb
 
K

KARL DEWEY

What do you want to "limit" -- the number of records pulled? If so the
insert like this --
SELECT TOP 15 xxx xxx xxx

One draw back to this is that if record 15 is equal to more records for the
same criteria then you will get additional records.
 
J

John Vinson

I really can't find answer to this question and thought I would post
here for an answer...

I was wondering if there is a LIMIT syntax associated with the SELECT
clause... under Access ?

Thanks for any response.

Diilb

Generally the TOP predicate will do this:

SELECT TOP 10 <fields> FROM <table>

will limit retrieval to 10 records.

John W. Vinson[MVP]
 
D

david epsom dot com dot au

You can use the MaxRecords property to determine or specify the maximum
number of records that will be returned by:

A query that returns data from an ODBC database in an Microsoft Access
database (.mdb).

A view that returns data from a SQL database in an Access project (.adp).

But it is not SQL - it's ODBC/OLEDB.

TOP implies that there is a sort order, which makes TOP queries much slower
than using the MaxRecords property where it is applicable.

(david)
 
Top