Using the Design View to Create a Query
- What is Base?
- Planning a database
- Creating a new database
- Creating database tables
- Defining relationships
- Creating a database form
- Accessing other data sources
- Using data sources in Apache OpenOffice
- Creating queries
- Using the wizard to create a query
- Using the design view to create a query
- Make a query with a calculated field
- Query with two related tables
- Query that summarizes data
- Query summarizing over a calculated field
- Creating reports
Using the Design View to Create a Query
Make a Basic Query
Creating a query using Design View is not difficult but does require learning the conventions of the tool. We will start with a duplicate of the query from the last section and then make some more complicated queries.
Our first query will display all the sales with an amount greater than or equal to 100, sorted by date.
Step 1: Open the query in Design View
Click Create Query in Design View in the Query's pane of the main Base window.
Step 2: Add tables
- Click Sales to highlight it.
- Click Add . Click Close .
Move the cursor over the bottom edge of the Sales table (Figure 192) and drag it to make it longer and easier to see all the fields in the table. |
Step 3: Add fields to the query definition table at the bottom
Double-click the PersonID, Date, and Amount fields to add them to the query definition table.
The table at the bottom of the query window should now have three columns populated. The row labeled Visible is used to toggle the visibility of the field in the final query result. The default is to show all the fields.
Step 4: Set the criterion for the query
We want the query results to have an Amount greater than or equal to 100 and the dates to be sorted in ascending order.
- Type >= 100 in the Criterion cell under Amount in the query definition table.
- Choose ascending from the dropdown list in the Sort row of the Date column.
- Click the Run Query icon in the Query Design toolbar, which is highlighted in red in Figure 194.
Step 5: Save and close the query
Save the query and also save the main Base document.
Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY). |