Creating Queries  «Prev  Next»

Creating Calculated Fields -Exercise Result

You entered:

Add Calculated Field in Table of Microsoft Access


This figure shows the Design view of your query.
Calculation Exercise
Here is the breakdown of the tables and relationships in the Microsoft Access query design:
Tables:
  1. Clients Table:
    • Fields:
      • Company
      • FirstName
      • LastName
      • Address
      • City
  2. Projects Table:
    • Fields:
      • Project ID
      • Company
      • Project Description
      • Start Date
      • Due Date
  3. Hours Table:
    • Fields:
      • HoursID
      • ProjectID
      • Date
      • Hours worked

Relationships:
  • Clients table is indirectly related to the Hours table through the Projects table.
    • Projects table has a foreign key relationship:
      • ProjectID (Primary Key in Projects) connects to ProjectID (Foreign Key in Hours).
    • Clients and Projects are related via the Company field.

Query Details:
  • Query Name: Project Hours - Select Query
  • Fields in Query:
    1. Hours worked (from the Hours table).
    2. Calculated field: Billable: [Hours worked]*50 (calculated as hours worked multiplied by 50).
Calculation Exercise
Your expression should look like this:
Billable: [Hours worked] * 50
Since Hours Worked is a field name, in must be enclosed in square brackets.
The results of the query look like this:
Clients, Projects, Hours
Clients, Projects, Hours

Namecheap 1