Topic 10: Query Criteria

Go to Topic 11 * Access Database Skills Table of Contents * Technology Skills

Examples of Query Criteria
Discuss the examples below. Then use one of the sample queries in the sample database to experiment with different criteria.

Text Fields
Exact matchLastnameSmith
 LEANO"0801"
 Grade"09" or "10"
"Like"LastnameLike "*sm*"
 EcoDisLike "Y*"
BlankBilingualIs Null
 Bilingual Not Null

Number Fields

Exact matchDaysAbsent0
 DaysAbsent0 or 1
RangeDaysAbsentBetween 0 and 5
ComparisonDaysAbsent>5

Date Fields
Exact MatchStartDate#9/1/2002#
RangeStartDateBetween #9/1/2002# and #6/30/2003#
ComparisonBirthDate<=#1/1/1985#

Criteria for checkbox fields (yes/no)
Yes-1
No0

Criteria for a parameter query (which prompts user for info)
CIPCode[For what CIP Code?]
StartDateBetween [Starting when?] and [thru when?]

Criteria based on a value on a form
StartDateBetween forms!reportmenu!date1 and forms!reportmenu!date2