Microsoft KB Archive/98301

{|
 * width="100%"|

PRA: Syntax Error When &quot;(&quot; Is First Character in Criteria Cell
'Article ID: Q98301

Creation Date: 02-MAY-1993

Revision Date: 19-SEP-1996' The information in this article applies to:


 * Microsoft Access versions 1.0 and 1.1

SYMPTOMS

You receive the error message &quot;Syntax error&quot; when you try to execute a query.

CAUSE

A opening parenthesis is the first character in a cell in the Criteria row of the query grid.

RESOLUTION

Depending on the WHERE clause you are using, you can restructure the query so that there is no opening parenthesis in the Criteria row. See below in the &quot;More Information&quot; section for an example.

You also can enter the WHERE clause directly in the SQL dialog box. If Microsoft Access places the opening parenthesis in the Criteria row, the process is successful. However, the process works only until you make a change to the query. For example, if you remove a column from the query grid, even if it is unrelated to the criteria, the error message is displayed.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

You may want an opening parenthesis in a Criteria cell if you are searching a Text or Memo field for several key words. For example, you may want to use a WHERE clause similar to the following:

(Textcol Like &quot;*performance*&quot; Or Textcol Like &quot;*speed*&quot;) And (Textcol Like *start*&quot; Or Textcol Like &quot;*run*&quot;) You can enter the WHERE clause either in a single cell in the Criteria row or as multiple rows in the Criteria section of the query grid. Place the Textcol column on the grid twice. In one or both instances of the column, the Show box may be cleared. The Criteria section of the grid should appear as follows: Textcol                Textcol -  - Criteria: Like &quot;*performance*&quot;    Like &quot;*start&quot; Or Like &quot;*run*&quot; or: Like &quot;*speed*&quot;         Like &quot;*start&quot; Or Like &quot;*run*&quot; Steps to Reproduce Problem

 Using the sample database NWIND.MDB, create a new query based on the Employees table. Drag the Last Name and First Name fields from the table to the query grid.  In the Criteria cell under Last Name, type the following: "(Like &quot;*a*&quot;)" Press TAB to move to the next cell. The &quot;Syntax error&quot; message appears. Choose OK. Note that the characters &quot;*a*&quot; are now highlighted.
 * }

-

"THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

Additional reference words: 1.00 1.10 parenthesis

KBCategory: kbusage kberrmsg

KBSubcategory: QryOthr