WD: Error Message: "Word Could Not Parse Your Query Options"

ID: Q113314


The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word 97 for Windows


SYMPTOMS

When you attempt to work with a mail merge data source, you may receive the following error message:

Word could not parse your query options into valid SQL string.
This problem will occur if any of the following is true:

Case 1:

You filter records using Query Options from the Insert Database or Mail Merge dialog box and you query a field in which at least one data record contains a number not immediately preceded by a letter. For example: "TV50" will work, "TV-50" will not.

Case 2:

The query on the field described in case 1 contains at least one letter, at any position.

Case 3:

The query contains text, but the SQL field is formatted as a Boolean field.

Case 4:

Your data source is a Word document named Where.doc.


CAUSE

This problem may occur in any of the following cases.

Case 1: Invalid Character in Compare To Field

The value used for the Compare To field in the Filter Records query contains an invalid character (symbol), such as an apostrophe.

Case 2: Complex Query Contains Combination of Numbers and Letters

All of the following conditions are true:

  • The first record in the Word document data source contains a field that begins with a number.

    -and-


  • The field is used as part of the query definition.

    -and-


  • The value used for the Compare To field in the query is text only or a combination of valid text characters and numbers.

    -and-


  • The value used for the Compare To field in the query is NOT a combination of valid symbols and numbers, for example 98102-0001.




For example, if you use a data source with the following values


    Data file: ID   Name      Address    City        State    Zip
               1J   John      1 2nd St   Seattle     WA       98109
               1S   Steve     2 1st St   Bellevue    WA       98004-0001
               1M   Mary      One M St   Everett     WA       Unknown
 
you will receive unexpected results:
  • Address Equal To One M St

    Result: SQL parse error message


  • ID Equal To 1M

    Result: SQL parse error message


  • Zip Equal To 98004-0001

    Result: Returns record #2 successfully.


  • Zip Equal To Unknown

    Result: SQL parse error message


Case 3: Inappropriate Criteria for the Field

The query contains inappropriate characters for field queried. For example, querying a Boolean field for "yes" (the appropriate query would be -1).

Case 4: Document Contains the Word "Where"

If your data source document contains the word "Where", you will receive the error message.


WORKAROUND

Cases 1-3

To work around this problem, use only valid characters in the Word document data source, and create the data source so that all fields in the first record begin with a valid character rather than a number.

Case 4

Rename your data source document to remove the word "Where".


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

The following tables show the valid and invalid characters for query tables.


   Valid Characters
   ----------------
   . (period)
   , (comma)
   - (hyphen)

Extended characters beyond ANSI code 128

   Invalid Characters
   ------------------

   ~ Tilde                   ! Exclamation
   @ At                      # Pound
   $ Dollar sign             % Percent
   ^ Caret                   & And  Asterisk
   _ Underline               + Plus
   \ Accent Grave            = Equal
   {} Curly braces          [] Square Brackets
   | Pipe                    \ Backslash
   : Colon                   ; Semicolon
   " Double quotation mark   ' Single quotation mark
   < Less than               > Greater than
   ? Question mark           / Forward slash
   () Parentheses 

Additional query words: database msquery

Keywords : kbualink97 kbmerge
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a,97
Platform : WINDOWS
Issue type :


Last Reviewed: October 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.