|
Unit 7. Queries (II) |
|
The Design view. |
|
If we look at the screen above, we have a tables area, in this area we put the tables that contain the data we need or we want to see in the result of the query, and in the part below named the QBE grid we define the query. Every column in the QBE grid corresponds to a field. Every row has a function: Field: here we place the field to use which will usually be the field to visualize, it could be a field from the table or a calculated field. Table: name of the table we want to extract the field from. This will be usefull when we are defining queries based on various tables. Sort: serves to arrange the resulting rows in a determinated order. Show: if not marked, the column does not appear in the result, it is usually unmarked when we want to use the field to define the query but don't want the field to appear in the result. E.g if we want the query to extract all the students from Denver we need the City field to select the students, but we do not want the city to appear in the result as we know that they are all from the same city that is Denver. Criteria: serve to specify the lookup criteria. A lookup criteria is a condition that records need to comply with to appear in the result of the query. It can be made up from one or from various conditions, joined by AND and OR operators. or: this row and those after are used to make multiple-conditions.
|
|
To add fields to the QBE grid we can:
|
|
Calculated fields are obtained from the result of an expression. If you would like to know more about how
to form expressions,
clic here
|
| The column heading usually contains the name of the column, but we can change the headings of columns in order to make the result of the query clearer. If we want to change this heading we must
indicate this in the Field: row, writing it
in front of the name of the field and followed by a colon (:). These are
usually used for calculated fields. In the query that appears above you
have an example in the second column, this one will have Year
in the heading, and in the column we will see the year of the date of
birth (we have a calculated field that uses the year(
) function, the function that obtains the year of a date). |
|
If we want to change the order of fields that have been included in the grid we can move a column (or various) either by dragging it or by cutting and pasting it.
Position the cursor over the extreme top
part of the column and when the arrow Move the cursor slightly so that the
Click on the Next create a column in blank in the position where we want to move the column that we have cut with the Columns option from the Insert menu. Select this column and click on the We can select various consecutive columns by selecting the first and maintaining the Shift key depressed, selecting the last column to select, both these columns and any found between them will be selected.
|
| |
|
Page. 7.2 |
|
Legal warning: Authorised on-line use only. It is not allowed the use of these courses in companies or private teaching centres.
|
|
© aulaClic. All rights reserved. Reproduction in any form whatsoever is prohibited.
April-2006.
|