Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 955
  • Last Modified:

MS Access and LIMIT Clause

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
DarkAngel88
Asked:
DarkAngel88
  • 3
1 Solution
 
arbertCommented:
Nope, about as good as it gets is "Select top 10 from table"

Brett
0
 
DarkAngel88Author Commented:
But what about if I want to select between the 30th and 40th entry ??
0
 
arbertCommented:
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
 
AccessHelpNetCommented:
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
 
arbertCommented:
Did you ever figure this out?  You going to close the question?

Brett
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now