Creating a Query with Unnamed Parameters

Visual Database Tools

Visual Database Tools

Creating a Query with Unnamed Parameters

You can create a query with an unnamed parameter by specifying a question mark (?) as a placeholder for a literal value. You can specify as many unnamed parameters in the query as you need.

Note   If you are using multiple parameters, you can use named parameters to help you distinguish them. For details, see Creating a Query with Named Parameters.

When you run the query in the Query Designer, the Define Query Parameters dialog box is displayed with "?" as the name of the parameter.

To specify an unnamed parameter

  1. Add the columns or expressions that you want to search to the Grid pane. If you do not want the search columns or expressions to appear in the query output, remove them as output columns.

Locate the row containing the data column or expression to search, and then in the Criteria grid column, enter a question mark (?).

By default, the Query Designer adds the "=" operator. However, you can edit the cell to substitute ">", "<", or any other SQL comparison operator.

See Also

Creating a Query with Named Parameters | Parameter Queries