Lesson 29 ª







Calculating Fields

The Calculating Fields allow us to use, in the columns of the Design View of Queries, the information that doesn't come from a field, but form a mathematical operation with values from other fields. Let's see this with an example. We will use our "Product" table. I have done a "Products" form; you should be able to do it on your own by now. I have also added some information in it for this example.

In it, we have the Product, the Unit Price and also the units In Stock.

Imagine we need to know the total value of the products we have in stock. This is a simple operation:

The total would be the result from multiplying the "In Stock" field times the "Unit Price" field for each product. Let's do this, or better yet, we will let Access do this for us. Since we already know how to use the Wizard, we will learn how to use it from the Design View.

The first step, as usual, is to go to the "Other" sub-menu.

And from here, we select the option "Query Design"

In the "Show Table" window, we select the "Products" table and we click on "Add".

In the next window, we will have the "Products" table with all its fields.

We only need the "Product Name" , "Product Description", "Unit Price" and "In Stock".