WD: Word Err Msg: Word Could Not Parse Your Query Options...

Last reviewed: February 27, 1998
Article 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 you do any of the following:

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 as 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 Is Named Where.doc

If your data source is a Word document is named Where.Doc, 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 a name other than Where.Doc.

STATUS

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

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 : kbmerge kbualink97 kbfaq
Version : 6.0 6.0a 6.0c 7.0 7.0a 97
Platform : WINDOWS


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: February 27, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.