- MS Access - Data Export
- MS Access - Data Import
- MS Access - Macros
- MS Access - Built-In Functions
- MS Access - Formatting Reports
- MS Access - Reports Basics
- MS Access - Controls & Properties
- MS Access - Formatting
- MS Access - SQL View
- MS Access - Combo Box
- MS Access - Navigation Form
- MS Access - Modify A Form
- MS Access - Create A Form
- Unmatched Query Wizard
- MS Access - Duplicate Query Wizard
- MS Access - Joins
- MS Access - Summarizing Data
- MS Access - Grouping Data
- MS Access - Indexing
- MS Access - Calculated Expression
- MS Access - Wildcards
- Many-To-Many Relationship
- One-To-Many Relationship
- One-To-One Relationship
- MS Access - Create Relationships
- MS Access - Relating Data
- MS Access - Alternate Criteria
- MS Access - Parameter Queries
- MS Access - Create Queries
- MS Access - Action Queries
- MS Access - Query Criteria
- MS Access - Query Data
- MS Access - Adding Data
- MS Access - Create Tables
- MS Access - Data Types
- MS Access - Create Database
- MS Access - Objects
- MS Access - RDBMS
- MS Access - Overview
- MS Access - Home
MS Access Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MS Access - Calculated Expression
In MS Access, an expression is pke a formula in Excel. This consists of a number of elements that can be used alone or in a combination to produce a result. Expressions can include operators’, constants, functions and identifiers.
Expressions can be used to perform a variety of tasks from retrieving the value of a control or supplying criteria to a query to creating calculated controls and fields or defining a group level for report.
In this chapter, we will be focusing on creating a very specific kind of expression called a calculated expression. We will create several calculated fields that will calculate and display data that is not stored anywhere within the database itself but calculated from separate fields that are stored.
We now have a new Access database that contains more data to calculate.
Example
Let us try an example to understand this. We will be retrieving some information from a variety of tables — tblCustomers, tblOrders, tblOrdersDetails and tblBooks and reviewing a variety of fields.
Let us now run the query and you will see the following results.
We want a very simple calculation for a subtotal which will take the quantity of the books ordered and multiply that by the retail price of the book. It is a good idea to begin every expression or any expression with a name to call that field. Let us call this one subtotal.
The full expression (Subtotal: [tblOrdersDetails]![QTY]*[tblBooks]![RetailPrice]) includes the table name, first tblOrdersDetails inside square brackets because that is where our quantity field pves. Now an exclamation is telpng Access to look inside that table for a field QTY and multiply that by the retail price field in tblBooks.
Let us try to run your query and you will see at end the subtotal field.
Let us say we want to calculate our sales tax. In the query grid we will do in the exact same way we did before and this time we will call the field simply Tax and Let us multiply Subtotal by nine percent tax rate.
Let us run your query again and you will see the new Tax field in the end.
Advertisements