2 major parts of a query window

Upload: jelly-berry

Post on 04-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 2 Major Parts of a Query Window

    1/3

    2 Major Parts of a Query Window

    1.) Design Area or the top portion displays the fields, tables, and queries that you may want touse in the query

    2.) Grid or the lower portion contains columns where you can set up the fields.Matching Text when you enter criteria in the cell, your text should be enclosed in quotes to distinguish

    it from operators and other expression.

    Criteria

    Description

    This will find all records that match exactly with the text string in the

    Criteria. Therefore, it will display all records whose Town matches with

    Claremont.

    This will display all records that match the word inside the

    quotes. It will display all records whose town entry is

    Claremont or Paris typing Alhambra in the or: category

    will also produced the same results.

    To exclude a value in the field, use the Not operator followed by the

    word enclosed in quotes.

    Field: City

    Table: Students

    Sort:

    Show: check

    Criteria = Claremont

    Field: City

    Table: Students

    Sort:

    Show: check

    Criteria = Claremont or Alhambra

    Field: City

    Table: Students

    Sort:

    Show: check

    Criteria = Not Claremont or:

  • 7/29/2019 2 Major Parts of a Query Window

    2/3

    Using Wildcards

    A wildcard is a special character that is used to substitute unknown characters in a query. The two

    commonly used wildcards are the asterisk (*) and the question mark (?).An asterisk represents any

    string of text while the question mark represents a single character only.

    Criteria Description

    This will find all records that start with the letter B in the Title field. Access will

    add the expression Like and place quotes around your criteria.

    This will display all records that end with ing in the field.

    This will find all records matched with the specified pattern. This will

    display Mary but not Maryl.

    Field: Title

    Table: Books

    Sort:

    Show: check

    Criteria: Like B*

    Or:

    Field: Title

    Table: Books

    Sort:

    Show: check

    Criteria: Like *ing

    Or:

    Field: FirstName

    Table: Students

    Sort:

    Show: check

    Criteria: Like Mar?

    Or:

  • 7/29/2019 2 Major Parts of a Query Window

    3/3

    You can also use > and < in defining criteria in text fields which may also return the same result.

    Although these are usually used in numbers and dates but can also be used for text.

    This will display all records beginning with any letter before the letter C in

    the alphabet.

    This will display all records beginning with any letter after the letter C in the

    alphabet.

    Field: FirstName

    Table: Students

    Sort:

    Show: check

    Criteria: < C

    Or:

    Field: FirstName

    Table: Students

    Sort:

    Show: check

    Criteria: > C

    Or: