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

Chapter 4. What Every Developer Needs to... > Refining Your Query with Criteria

Refining Your Query with Criteria

So far, you have learned how to select the fields you want and how to indicate the sort order for your query output. One of the important features of queries is the capability to limit your output by selection criteria. Access allows you to combine criteria by using any of several operators to limit the criteria for one or more fields. The operators and their meanings are covered in Table 4.1.

Table 4.1. Access Operators and Their Meanings
OperatorMeaningExampleResult
=Equal to="Sales"Finds only those 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 values less than or equal to 100 in that field.
>Greater than>100Finds all records with values greater than 100 in that field.
>=Greater than or equal to>=100Finds all records with 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 than one 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 of "CA", "NY", or "UT" in the field.
LikeCompares a string expression to a patternLike "Sales*"Finds all records with the value of "Sales" at the beginning of the field.
BetweenFinds a range of valuesBetween 5 and 10Finds all records with the values of 5–10 (inclusive) in the field.
InSame as OrIn("CA", "NY","UT")Finds all records with the value of "CA", "NY", or "UT" in the field.
NotSame as not equal toNot "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 not NullIs Not NullFinds all records where data has been entered the field.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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