MS Access

A Quick Review

The in Design view.
A close-up of the design grid.

Before we start tackling the functions and types of queries, let's take a step back and review. This lesson is more of a "cheat sheet" than an exercise. Hopefully, it will help you remember what you already know about queries. Figure shows the in Design view, Figure shows a close-up of the design grid, and Table outlines the Common Criteria Operators.

Common Criteria Operators
Operator Example Description

=

="MN"

Finds records equal to MN.

"MN"

Finds records not equal to MN.

<

<10

Finds records less than 10.

< =

<=10

Finds records less than or equal to 10.

>

>10

Finds records greater than 10.

> =

>=10

Finds records greater than or equal to 10.

BETWEEN

BETWEEN 1/1/99 AND 12/31/99

Finds records between 1/1/99 AND 12/31/99.

LIKE

LIKE "S*"

Finds text beginning with the letter "S." You can use LIKE with wildcards such as *.

NOT

NOT "MN"

Finds records not equal to MN.

IS NULL

IS NULL

Finds records whose fields are empty.

IS NOT NULL

IS NOT NULL

Finds records whose fields contain values.


TO CREATE A QUERY IN DESIGN VIEW

  1. CLICK THE QUERIES ICON IN THE OBJECTS BAR, THEN DOUBLE-CLICK CREATE QUERY IN DESIGN VIEW.

  2. SELECT THE TABLE OR QUERY YOU WANT TO USE AND CLICK ADD.

  3. REPEAT STEP 2 AS NECESSARY FOR ADDITIONAL TABLES OR QUERIES. CLICK CLOSE WHEN YOU'RE FINISHED.

  4. DOUBLE-CLICK EACH FIELD YOU WANT TO INCLUDE FROM THE FIELD LIST.

    OR...

    DRAG THE FIELD FROM THE FIELD LIST ONTO THE DESIGN GRID.

  5. IN THE DESIGN GRID, ENTER ANY DESIRED SEARCH CRITERIA FOR THE FIELD IN THE CRITERIA ROW.

  6. CLICK THE SORT BOX LIST ARROW FOR THE FIELD AND SELECT A SORT ORDER.

  7. CLOSE THE QUERY WINDOW.

  8. CLICK YES TO SAVE THE QUERY, ENTER A QUERY NAME, AND THEN CLICK OK.

by BrainBellupdated
Advertisement: