Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a.

Slides:



Advertisements
Similar presentations
Microsoft® Access® 2010 Training
Advertisements

Microsoft Access 3 Database Creation and Management.
An Introduction to Forms (continued). The Major Steps of a MicroSoft Access Database  Tables  Queries  Forms  Macros  Reports  Modules On our road.
Customizing Reports. Custom Reports A report is a formatted hardcopy of the contents of one or more tables from a database. Although you can format and.
Concepts of Database Management Seventh Edition
Microsoft Access 3 Database Creation and Management.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Access Tutorial 3 Maintaining and Querying a Database
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
Querying a Database Microsoft Office Access 2003.
Microsoft Access 2010 Chapter 7 Using SQL.
Access Tutorial 3 Maintaining and Querying a Database
Chapter 2 Querying a Database
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory.
Chapter 3 Maintaining a Database
Maintaining and Querying a Database Microsoft Access 2010.
SESSION 5.1 In this session we will be exploring Pattern Match Queries List-Of-Values Queries, Non-Matching Values in Queries Both the “And” and the “OR”
DAY 16: ACCESS CHAPTER 2 Tazin Afrin October 10,
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Lesson 31: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Design.
You can use a query to view a subset of your data or to answer questions about your data. For example, if you want to view a list of student names and.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall1 Exploring Microsoft Office Access Committed to Shaping the Next Generation.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Queries. What is a query? A query is actually the name for any database manipulation operation. The most commonly used type is a select query, which is.
Microsoft Access 3 Database Creation and Management.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 4 BACKNEXTEND 4-1 LINKS TO OBJECTIVES Query Design Query Criteria Modify a Query Using OR.
On Line Viewing Tip #1: While viewing this presentation in your browser, select Browse, Full Screen. Then, when you want to pause the show, Right Click.
1 By: Nour Hilal. Microsoft Access is a database software where data is stored in one or more Tables. A Database is a group of related Tables. Access.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Microsoft ® Access ® 2010 Training Create Queries for a New Database If a yellow security bar appears at the top of the screen in PowerPoint, click Enable.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
Concepts of Database Management Seventh Edition
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making Chapter.
Performing Calculations—1 of 2 In addition to using queries to retrieve, update, sort, and filter data in a database, you can use a query to perform calculations.
® Microsoft Access 2010 Tutorial 3 Maintaining and Querying a Database.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
Microsoft Access. Microsoft access is a database programs that allows you to store retrieve, analyze and print information. Companies use databases for.
® Microsoft Office 2013 Access Maintaining and Querying a Database.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
An Introduction to Forms. The Major Steps of a MicroSoft Access Database  Tables  Queries  Forms  Macros  Reports  Modules On our road map, we are.
Customizing Reports Adding a Date to a Report Reference Window Adding a Date to a Report Display the report in the design view Click the Text Box Tool.
DAY 18: MICROSOFT ACCESS – CHAPTER 3 CONTD. Akhila Kondai October 21, 2013.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
Creating a multi-page form using Tab Controls. In today’s class, we will be using the Tab Control method to create the Form / SubForm combination.
Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.
Creating Advanced Queries and Enhancing Table Design.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
MICROSOFT ACCESS – CHAPTER 3 CONTD. Sravanthi Lakkimsetty Mar 09, 2016.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Access Chapter 2 Querying a Database.
Microsoft Office Access 2003
Tutorial 3 – Querying a Database
Microsoft Office Access 2003
Microsoft Office Access 2003
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a query, changing a datasheets appearance, using a comparison operator and “And / Or” logical operators.

Before we continue! Let’s stop for a moment to consider a possible hazard that might take place if we are not careful.

Unlike many other database programs, Microsoft Access has two kinds of queries. The 1st is the Select query, The second is called an Action query.

In the past, the primary purpose, and in most cases the only purpose of a query was to “Select” specific records for viewing. In Access, this type of query is referred to as a “Select Query”

Access, on the other hand has a second type of query, called an “Action Query”. An Action Query is a query that adds, changes, or deletes multiple table records at one time.

We could, for example, create an “Action Query” that will delete selected records. To cause this action to occur, we would “RUN” the query.

The purpose of a Select query is to “VIEW” the datasheet with just the records selected by the criteria used. To cause this to happen we could also “RUN” the query. To test an Action query, we will need to “VIEW” it’s datasheet before we actually “RUN” the query.

If we get into the habit of “Running” select queries to “VIEW” the datasheet, when we want to test an “ACTION” query to see if it will return the proper data, we might by accident, “RUN” the query thinking that we will see it’s datasheet.

The “ounce of prevention” to use here, in order to prevent the need for a “pound of cure” would be to use the “VIEW” method whenever we want to see the datasheet instead of “Running” the query.

Use the “RUN” method only when you need to cause an Action query to do the action that it was designed for. To test an Action query (view the Datasheet) before running it, use the “VIEW” method, and to view the datasheet of a Select query, also use the “VIEW” method.

In this session we will look at defining record selection by using criteria and creating calculated fields in Select queries. The Criteria Row

Just as you can display selected fields from a table in a query’s datasheet, you can display selected records. To tell Access which records you want to select, you can specify a condition as part of a query. A condition is a criterion, or rule, that determines which records are selected. To define a condition for a field, you place the condition in the field’s Criteria text box in the design grid.

A condition usually consists of an operator, often a comparison operator, and a value. A comparison operator asks Access to compare the values of a database field to the condition value and to select all the records for which the relationship is true.

For example, the condition > for the InvoiceAmt field selects all records in the Order table having InvoiceAmt field values greater than

Operator Meaning = Equal to (optional, default operator) Example =“Hall” Operator Meaning < Less than Example <#1/1/99#

Operator Meaning < = Less than or equal to Example <=100 Operator Meaning > Greater than Example >100

Operator Meaning > = Greater than or equal to Example >=100 Operator Meaning Not equal to Example <>”Hall”

Operator Meaning Between … And... between two values (inclusive) Example Between 50 And 100 Operator Meaning IN () in a list of values Example In (“Hall”, “Seeger”)

Operator Meaning Like matches a pattern that includes wildcards Example Like “706*” These operators will be placed on the criteria row below, in the design grid.

It’s worthwhile to mention here that you can use multiple selection criteria in queries. In other words, you can place specific criteria in as many fields as you have in the query. We will see an example of this in today’s exercise.

Another important function that you will use queries for is to create new fields by calculating values. These calculations can be either numeric or can manipulate text.

An example of manipulating text would be to combine the City, State and Zip fields into one field or to extract the Area Code from the phone # field and place it in a separate field.

To perform a calculation, you define an expression containing a combination of database fields, constants, and operators. To perform a calculation in a Query, you add a calculated field to the query. A calculated field is a field that displays the results of an expression. A calculated field appears in a query datasheet but does not exist in a table.

Field Name Expression Separator An Expression in a query is made up of three components: Calculated Field

When you “VIEW” or “RUN” a query that contains a calculated field, Access evaluates the expression defined by the calculated field and displays the resulting value in the datasheet.

Microsoft Access will calculate an expression in the following order: 1. Parentheses 2. Exponents (to power of) 3. Multiplication 4. Division 5. Addition 6. Subtraction

You can remember this with the phrase: Please Excuse My Dear Aunt Sally. 1. Parentheses 2. Exponents (to power of) 3. Multiplication 4. Division 5. Addition 6. Subtraction

Another function of a query is to calculate statistical information, such as totals, counts, and averages. Aggregate functions in a query perform arithmetic operations on selected records. Queries that perform this kind of operation are sometimes referred to as Aggregate Queries.

To create an aggregate query you can click on the Aggregate button on the toolbar. When you create an Aggregate Query a new row will appear in the Design Grid.

You can select the function that you want Access to perform by clicking on the selection arrow in the Totals row in the column that you want the function performed in. A list of available functions will appear.

An alternative method of creating an aggregate query is to use “View” from the Menu Bar and clicking on “Totals”

Finally in today’s session we will look at Lookup fields. Lookup Fields are created by changing the data type in the table to “Lookup”. This can be done in two ways: 1) Manually and 2) with a wizard.

A lookup field provides the user when entering data with a selection box to choose the data that he or she wants to enter into a field.

The selection box will use either another table that contains the appropriate data or you can enter the data into the properties of the field in a value list.

To manually create a lookup field, first select the field and then click on the lookup tab in the field properties section.

Select Combo Box Select Table/Query or Value List to enter your own values.

If you select Table/Query above select the table or query name to use here. If you select value list, type the values in here.

Select the column in the table or query or value list that contains the data you want inserted into your field when you make your selection.

Tell Access how many columns you want to appear in your selection list when you activate the lookup box.

Tell Access whether or not you want column heads to appear when you activate your lookup box. (Yes or No)

Tell Access how wide each column will be in your lookup box.

Tell Access how many rows will appear in your lookup box. If there are more rows in the source of data a scroll bar will appear.

Tell Access how wide the lookup box will be. This is generally the total of the column widths above.

And finally, indicate that you want the user to either be able to type anything in this field or just what appears in the list.

Page AC 3.37 Quick Check Review

Let’s take a few moments to break up into discussion groups. Each group will discuss the quick check questions on page AC 3.37 in your books. We will then review the answers at the end of the discussion.

Quick Check Review Session 3.2 1) A(n) ________ is a criterion, or rule, that determines which records are selected for a query datasheet.

Quick Check Review Session 3.2 2) In the design grid, where do you place the conditions for two different fields when you use the And logical operator? The Or logical operator?

Quick Check Review Session 3.2 3) To perform a calculation in a query, you define a(n) ___________ containing a combination of database fields, constants, and operators.

Quick Check Review Session 3.2 4) How does a calculated field differ from a table field?

Quick Check Review Session 3.2 5) What is an aggregate function?

Quick Check Review Session 3.2 6) The ________ operator divides selected records into groups based on the values in a field. And Finally!

As we saw in the last session, Barbara Hennessey and her office staff need to track information about all the orders for which bills have been paid. For Barbara’s request you will need to create a query that will display only those records in the Order Table with the value of 1/15/99 in the BillingDate field.

Both Barbara and Leonard are beginning to see the value of what this program has and now have begun to request much more information. As a result, the staff at Valle Coffee have once again requested your assistance,

At a recent company meeting, Leonard Valle and other Valle Coffee employees discussed the importance of regularly monitoring the business activity of the company’s restaurant customers. For example, Kim Carpenter and her marketing staff track customer activity to develop new strategies for promoting Valle Coffee Products.

Barbara Hennessey and her office staff need to track information about all the orders for which bills were sent out on a specific date so that they can determine better the bills have been paid.

In addition, Leonard is interested in analyzing the payment history of restaurant customers to determine which customers pay their invoices in a timely manner, which customers have higher invoice amounts, and so on.

All of these informational needs can be satisfied by queries that retrieve information from the Restaurant database.

You have been requested to help the people at Valle Coffee with creating queries that will answer their questions. Your assignment today is to do the class exercises starting on Page AC 3.19 through page AC And Page AC 5.04 through page AC 5.08