Microsoft KB Archive/166884

= PRB: Query Designer Does Not Add Parenthesis to Criteria =

Article ID: 166884

Article Last Modified on 5/2/2006

-

APPLIES TO


 * Microsoft Visual Database Tools

-



This article was previously published under Q166884



SYMPTOMS
If you type the following example in the Grid pane of the Query Designer:

Column Criteria

EmpId IN 123, 456

The following error message appears:

Missing subquery or the operator you entered requires parenthesis.



CAUSE
Invalid SQL syntax has been entered into the criteria cell. In SQL2, the comparison operation IN requires parenthesis around its contents:

IN (table-expression) or IN (value-list)



RESOLUTION
Add parenthesis around the table-expression or value-list before tabbing out of the field.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Open or create a new Visual InterDev project. Add a dataconnection to your project. Double-click one of your tables to invoke the Query Designer. On the Query toolbar, click the first four icons to display the four panes to the Query Designer. In the Grid Pane, select a field in the "Column" column, and type the following in the Criteria field:

In 123, 456

</li> Tab out of the Criteria field. The error message appears.</li></ol>

<div class="references_section">