Microsoft Knowledge Base

"Error in Expression..." Adding Criteria Value with Bracket

Last reviewed: September 12, 1996
Article ID: Q119098
The information in this article applies to:
  • Microsoft Query for Windows 95, version 2.0
  • Microsoft Query for Windows, version 1.0
  • Microsoft Query for the Macintosh, version 1.0

SYMPTOMS

In Microsoft Query, when you add criteria to a query for a field, and the criteria value contains the bracket characters ([]), you receive the following error message:

   Error in expression: value
   Invalid Column name: 'value'

If the criteria value contains a single left bracket character ([), you receive the following error message:

   Missing ')', ']', or '|'

CAUSE

This error message appears when you use the Add Criteria or Edit Criteria dialog box to add the criteria, and you do not enclose the value that contains the bracket character(s) in single quotation marks. The error message appears because the bracket characters are reserved characters, and are used when you compare the value of a field in one table to the value of a field in another table. For example, the following value

   [CUSTOMER].[CUSTMR_ID]

refers to the CUSTMR_ID field in the CUSTOMER table.

Note that if you enter a value in the Value box of the Criteria pane, and the value contains a bracket character, the single quotation marks are automatically added, and no error message appears.

You do not receive an error message if you use a value that contains a single right bracket character.

WORKAROUND

To avoid receiving an error message when you enter a value that contains a bracket character in the Add Criteria or the Edit Criteria dialog box, enclose the value in single quotation marks, as in the following examples:

   '[Jill'
   '[Brian]'

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

For more information about the Add Criteria Command (Criteria Menu), choose the Search button in Help and type:

   criteria: adding


KBCategory: kbtool
KBSubcategory: xlquery

Additional reference words: 1.00 5.00 err msg dBASE4 paradox foxpro



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" 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.

Last reviewed: September 12, 1996
©1997 Microsoft Corporation. All rights reserved. Legal Notices.