Page 51 - ModularV1.1 _c8_flipbook
P. 51

CREATING A QUERY

                 Access allows you to create or build a query and save in the database so that you can run it
                 multiple times. The Query Design command present under the Queries group on the Create
                 tab is used to create a query. To create a query, follow these steps:
                 Step 1  Click on the Query Design command from the Queries group under the Create tab.








                                                            Creating a query
                 Step 2  The  Show Table dialog box will open.
                         Select the desired table and click on the
                         Add button.
                 Step 3  Add the field's name to the query window
                         and specify the criteria.
                 The parameters of the design grid in the bottom
                 part of the Query window are:

                    Field: It is the first row of the design grid that
                   displays  the  selected  field  names  from  the
                   table.                                                          Defining query criteria
                    Table: It displays the names of the existing tables in the relationship window.

                    Show: This means the fields with checkmark will be displayed in the result and the fields
                   without checkmark will not be displayed when the query runs.
                    Sort: It displays the data in either descending or ascending order during the run time.

                    Criteria: This displays the condition on the basis of which the records will be filtered and
                   displayed in the query output.
                    Or: It is used to set multiple conditions in a query.

                 After  creating  the query,  we need to run  the query  by

                 clicking on the Run button         . The related records of

                 the query will be displayed in the Datasheet view.                          Query result

                 Using Multiple Criteria

                 You can also use multiple criteria while creating a query.
                 Perform the following steps to use multiple criteria:
                 Step 1  Add a table in the Query window by using the
                         Show Table dialog box.

                 Step 2  Set the criteria in the Criteria row. In this case,
                         we have set the condition >160 in the Criteria
                         row and <180 in the Or row for Marks field.
                                                                                        Using multiple criteria

                                                                                           Queries in MS Access   49
   46   47   48   49   50   51   52   53   54   55   56