
Step 4: Set the criterion for the query.
We want the query’s FuelID to begin with the numeral 1.
1) Type >0 in the Criterion cell under FuelID in the query table.
2) Click the Run Query icon in the Query Design toolbar.
Figure 223: Query Design toolbar
Figure 224 contains the Fuel table with my entries and the query results based upon
the Fuel table: the query results are in the right table.
Figure 224: Fuel table and query of the fuel table
Step 5: Save and close the query.
Since this query contains the ending odometer reading for our calculations, name it
End-Reading when saving it. Then close the query.
Step 6: Create the query to calculate the fuel economy.
1) Click Create Query in Design View to open a new query.
2) Add the Fuel table to the query just as you did in step 2: Add tables But, do
not close the Add Tables window.
3) Add the End-Reading query to this query.
a) Click Queries to get the list of queries in the database.
Figure 225: Selecting queries to add to another query
b) Click End-Reading.
c) Click Add, and then click Close.
Step 7: Add fields to the table at the bottom of the query.
We are going to calculate the fuel economy. To do this we need the FuelQuantity and
distance traveled. Since the FuelQuantity we want to use is at the ending odometer
reading, we will use the End-Reading query to get it. We will also use the Odometer
field from the Fuel table and End-Reading query.
Chapter 8 Getting Started with Base 241
Comentarios a estos manuales