Page 4 of 11PREVNEXT

Queries III: Use expressions and other criteria

Types of selection criteria


You can use four basic types of criteria in your select queries.

Callout 1 Text. You use text criteria with fields set to the Text data type. Remember, text data can include numbers, and so can your criteria. When you press ENTER to commit your criteria, Access surrounds it with quotation marks. If Access doesn't, just add them yourself. For example, if you use a criteria such as 98118, your query returns just the items in that postal code.
Callout 2 Numbers. You use number criteria in fields set to the Number data type. For example, 40 returns all products that cost $40. Don't use quotation marks here, those are only for use with textual data.
Callout 3 Dates. You can use date criteria in a variety of ways. For example, #04-14-2012# returns all records for sales on that day, while Between #01-01-2012# And #02-15-2012# returns all records for that date range. Remember to type number signs (#) around your dates, but don't worry about quotation marks. Access doesn't use them for dates and times.
Callout 4 Expressions. An expression is a combination of math operators, functions, and names of fields. Expressions can be quite powerful, and you can use them in a variety of ways, such performing calculations and manipulating text. For example, the expression in the picture adds the values in two fields — Subtotal and Price — and displays the results in a calculated field called "Shipping."

The rest of this course shows you some basic expressions, and the next course explores them in more depth. Let's start with expressions that compare values.

Page 4 of 11PREVNEXT