Page 7 of 11PREVNEXT

Queries III: Use expressions and other criteria

Criteria used in a parameter query

A parameter query asks for input before it runs. For example, if you want to see orders placed between certain dates, a parameter query can prompt you to enter starting and ending dates, and the query will return just the records that fall between the dates you enter.

In other words, parameters are another type of filter that you build into your query. Here's one example:

Callout 1 You can use the Between … And operator, but instead of using criteria or an expression, you enter text, and you surround that text with square brackets. The text should tell users the type of value they need to enter, such as a price or a starting date. The picture shows a typical example.
Callout 2 When you run the query, dialog boxes display your text and allow you to enter one or more values. The query then returns only the records that fall within the range you specify.

With this technique, you have to enter a whole value in a field — an entire date, an entire name, and so on. If you don't know the entire value, you can use wildcard characters in your parameters, and we’ll show you how to do that next.

Page 7 of 11PREVNEXT