Operation Manual

Figure 236 is a record with data inserted in its fields.
Figure 236: Sample record of the Vacation form and sub form
Creating queries
Queries are used to get specific information from a database. Query results are special tables
within the database.
To demonstrate the use of queries, we will use two different methods:
Using our CD-Collection table, we will create a list of albums by a particular artist. We will
do this using the Wizard.
The information we might want from the Fuel table includes what our fuel economy is. We
will do this using Design View. (Queries that require calculations are best created with
Design view.)
Using the Wizard to create a query
Queries created by the wizard provide a list or lists of information based upon what one wants to
know. It is possible to obtain a single answer or multiple answers, depending upon the
circumstances.
In the main database window (Figure 205), click the Queries icon in the Database section, then in
the Tasks section, click Use Wizard to Create Query. The Query Wizard window opens (Figure
237). The information we want is what albums are by a certain musical group or individual (the
album’s author). We can include when each album was bought.
Note
When working with a query, more than one table can be used. Since different tables
may contain the same field names, the format for naming fields in a query is Table
name.field name, with a period (.) between the table name and the field name. For
example, the Lunch field of the Vacation table used in a query has the name
Vacation.Lunch.
246 | Getting Started with LibreOffice 5.0