?
Solved

MS Access and LIMIT Clause

Posted on 2003-03-12
5
Medium Priority
?
949 Views
Last Modified: 2012-06-27
Hi,

I'm wondering if the "LIMIT" clause works with MS Access.

I'm accessing a DB from a PHP page and I have to make a search with some
limits.  I tried "SELECT * FROM table LIMIT 0, 10;" in the build-in SQL
query in MS Access but it says "Syntaxe error in FROM clause".

Can anyone help me in this one please ?

Thanks in advance !!

DA
0
Comment
Question by:DarkAngel88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 40 total points
ID: 8121851
Nope, about as good as it gets is "Select top 10 from table"

Brett
0
 

Author Comment

by:DarkAngel88
ID: 8121882
But what about if I want to select between the 30th and 40th entry ??
0
 
LVL 34

Expert Comment

by:arbert
ID: 8122540
You would have to do that based upon a unique key on the table and selecting the records based upon the max value from the last key selected.....
0
 
LVL 2

Expert Comment

by:AccessHelpNet
ID: 8122903
Its not pretty or fast or very flexible but this syntax will would get you entries 30-40 from a table where recordid is a unique or primary key in MS Access :

select * from (select top 10 * from (select top 40 * from table order by recordid asc) order by recordid desc) recordid order by recordid asc

If recordid is not unique or you have a complex sort, expanding on this gets pretty hairy.

best regards,

Dave Kawliche
0
 
LVL 34

Expert Comment

by:arbert
ID: 8558865
Did you ever figure this out?  You going to close the question?

Brett
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question