I'm having a problem using the LIMIT clause for a select statement. I want to limit the number of rows selected in my query to a range, of some many per page, so I planned on using LIMIT startingpoint,numberofrows. For some reason I get this error:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'loginname limit 10'., SQL state 37000 in SQLExecDirect

Is my syntax wrong, or do I need to find out some other method of acomplishing this? I'd like to avoid querying the entire table, and using PHP to filter it, I'd rather just limit it with the query itself. Any idea what my problem is? Here is the query that produced the above results.

SELECT * FROM Customers ORDER BY LoginName LIMIT 10

Miles
miles@uscyber.net

    limit isn't supported by access, I believe. It definatly isn't SQL standard. You may want to check msdn.microsoft.com for a work around

      Thanks for the clarification.

      Can you remember any other alternatives? (I remember seeing ROWNUM in a few places, but that didn't seem supported either)

      Miles
      miles@uscyber.net

        Write a Reply...