Microsoft KB Archive/92690

= ACC: Limit on ANDs in SQL Select Statement =

Article ID: 92690

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q92690



Moderate: Requires basic macro, coding, and interoperability skills.

There is an undocumented limit on the number of ANDs that you can use in a SQL Select statement. The limit is 40 ANDs in a WHERE clause and 40 ANDs in a HAVING clause.

Microsoft Access 1.x returns the following error message when you exceed this limit:

Out of Memory

Microsoft Access 2.0, 7.0 and 97 return the following error message when you exceed this limit:

Query is too complex

Keywords: kberrmsg kbinfo kbusage KB92690

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.