
Chapter 7: Databases and Data Sources
The default type of join is an Inner join, which only returns records where the joined fields
are equal. If the Type field for an appointment does not contain data, the join field for that
appointment's record would not match any entries in the join field in the Types table.
We can fix this by changing the join type in the query.
1. Right-click the join line between the tables in the top portion fo the query design.
2. Choose Edit.
3. In the Join Properties dialog, in the Options section, click the Type drop-down and
choose Left join.
4. Click OK.
5. Save the query.
6. Close the query.
7. Save the database.
Creating a report
A query can, of course, be viewed and used by double-clicking to execute the query. It can
also be used as the underlying data for a form. The form wizard has already been discussed.
Copying a form and changing the underlying data has also been discussed.
A query or a table can also be used to generate a report. The following section uses the
Appointments for Today query created in the steps above as the basis for a report.
1. Click the Reports icon on the left side of the database window.
2. Click Use Wizard to Create Report.
3. The Report Wizard opens to Step 1, Field Selection. Change the Tables or queries
drop-down to Query: Appointments for Today.
4. Click the >> button to move all the fields from the Available fields list to the Fields
in the report list.
5. Click Next.
6. In Step 2, Labeling fields, click Next to use the default labels.
7. Step 3, Grouping, can also be skipped since this report does not really need
grouping. Click Next without moving any fields.
Note: Grouping is a way of collecting records that share certain data. For example, we could create another report
grouped by Type. This report would list all of the appointments of each type together. Grouping creates the first
levels of sorting in any report with grouping.
8. Step 4, Sort options, is automatically skipped because a query is selected. This may
be changed in later versions.
OpenOffice.org User Guide for 2.x 375
Kommentare zu diesen Handbüchern