• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 10. Creating Queries > Refining a Query by Using Criteria

Refining a Query by Using Criteria

So far in this hour, you have learned how to select the fields you want and how to indicate the sort order for query output. One of the important features of queries is the ability to limit output by using selection criteria. Access allows you to combine criteria by using several operators to limit the criteria for multiple fields. Table 10.1 covers the operators and their meanings.

Table 10.1. Access Operators
OperatorMeaningExampleResult of Example
=Equal to="Sales"Finds only records with "Sales" as the field value.
<Less than<100Finds all records with values less than 100 in that field.
<=Less than or equal to<=100Finds all records with or equal tovalues less than or equal to 100 in that field.
>Greater than or equal to>100Finds all records with values greater than 100 in that field.
>=Greater than>=100Finds all records with or equal to values greater than or equal to 100 in that field.
<>Not equal to<>"Sales"Finds all records with values other than Sales in the field.
AndBoth conditions must be trueCreated by adding criteria on the same line of the query design grid to more thanone fieldFinds all records where the conditions in both fields are true.
OrEither condition can be true"CA" or "NY" or "UT"Finds all records with the value "CA", "NY", or "UT" in the field.
LikeCompares a string expression to a patternLike "Sales*"Finds all records with the value "Sales" at the beginning of the field (the asterisk is a wildcard character).
BetweenFinds a range of valuesBetween 5 and 10Finds all records with the values 5–10 (inclusive) in the field.
InSame as OrIn("CA","NY","UT")Finds all records with the value "CA", "NY", or "UT" in the field.
NotSame as <>Not "Sales"Finds all records with values other than Sales in the field.
Is NullFinds nullsIs NullFinds all records where no data has been entered in the field.
Is Not NullFinds all records that are not nullIs Not NullFinds all records where data has been entered into thefield.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint