Operation Manual
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 the final odometer reading, we will use the End-
Reading query to get it. We will also use the Odometer field from both the Fuel table and End-
Reading queries.
Figure 252: Tables in this query
1) Double-click FuelQuantity in the End-Reading query.
2) Double-click Odometer in the End-Reading query.
3) Double-click Odometer in the Fuel table.
Figure 253: Added fields to the query
Step 8: Enter the FuelID difference field
We want the difference between the FuelID value of the Fuel table and FuelID value of the End-
Reading query to equal one (1).
1) Type "End-Reading"."FuelID" - "Fuel"."FuelID" in the field to the right of the
Odometer field of the Fuel Table. (Figure 254)
2) Type ='1' in the Criterion cell of this column.
3) Leave the Visible cell of this column unchecked.
4) Calculate the distance traveled:
– Type in the Field cell (Figure 255):
"End-Reading"."Odometer" - "Fuel"."Odometer"
– In the Alias row, type Distance.
– Type >'0' in the Criterion cell.
5) Calculate fuel economy: Type
("End-Reading"."Odometer" - "Fuel"."Odometer")/"End-
Reading"."FuelQuantity"
in the next column to the right of the word Field (Figure 256).
6) Type Fuel Economy as the alias.
Chapter 8 Getting Started with Base | 259