Succeeding in Business with Microsoft Excel 2003: A Problem

XP
Chapter 3
Analyzing Data For Effective Decision
Making
“The human problems which I deal with every day—concerning
employees as well as customers—are the problems that fascinate
me, that seem important to me.”
—Hortense Odlum
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
1
XP
Level 2 Objectives:
Creating More Complex Queries
•
•
•
•
Design queries that compare data from more than
one table
Refine table relationships by specifying the join type
Perform calculations in queries
Customize queries and their results
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
2
Evaluating Data Using SpecialXP
Types of Queries
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
3
XP
Using Queries to Find Duplicate
Records
•
Duplicates Query Wizard
 Searches for duplicate values in fields
 Improve business operations
 Designed to identify records that contain same
information in particular field
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
4
XP
Using Queries to Find Unmatched
Records
•
Find Unmatched Query Wizard
 Compares records in two specified tables or recordsets
 Finds all records in one table or query that have no
related records in second table or query
 Requires that two tables being compared have
common field
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
5
XP
Limiting the Records in the Query
Results
•
•
Limiting results to only a few records often aids
analysis
Top Values query
 Sorts and then filters records
 Display specified number of records that contain top or
bottom values
 Top Values list box on query design toolbar
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
6
Top Values Query Design andXP
Results
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
7
XP
Using Parameter Values in Queries
•
Parameter values
 Phrase usually in form of a question or instruction
 Enclosed in square brackets
 Serves as prompt to user to enter value
 Example
• [Enter a job ID]
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
8
Parameter Query to Allow UserXP
Input when the Query Is Run
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
9
Analyzing Data from More thanXP
One Table
•
Data from more than one table required to answer
question
 Combine records from two or more tables
 Display only information needed
•
•
Work in design view to specify criteria for selecting
records from multiple tables
Lines between tables link primary key to foreign key
field
 Primary key designated with 1
 Foreign key designated with ∞
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
10
Analyzing Data from More thanXP
One Table (continued)
•
Join tables
 Linking of tables using primary and foreign keys
 Established relationship
 Or
• Each table shares field with same or compatible data
type
• One join field primary key
•
If tables do not include fields that can be joined
 Add one or more extra tables or queries
 Link tables that contain the data
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
11
Analyzing Data from More thanXP
One Table (continued)
•
•
Use queries as source of underlying data for another
query in place of one or more tables
Create queries based on more than one object
 Should not use any table or query that does not have
common field with at least one of the other tables or
queries
 Otherwise Access displays every combination of
records between two tables
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
12
XP
Refining Relationships with
Appropriate Join Types
•
Inner join
 Displays all records in one table that have
corresponding values in common field in another table
 Records must match before being displayed in query
results
•
Outer join
 Display all records of one table
 Regardless of whether corresponding record stored in
related table
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
13
XP
Inner Join
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
14
XP
Left Outer Join
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
15
XP
Right Outer Join
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
16
Refining Relationships with
Appropriate Join Types
(continued)
•
XP
Outer join types
 Left
 Right
•
Use join properties dialog box
 To change join type
 By default tables related using inner joins
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
17
Using Logical Operators to
Specify Multiple Conditions
•
XP
Logical operators
 Test values that can only be true or false
•
Place conditions in separate fields in same criteria
row of design grid
 All conditions in row must be met to select record
•
NOT logical operator
 Excludes values that don’t meet criterion
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
18
XP
Logical Operators
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
19
Performing Calculations withXP
Queries
•
Any information derived from fields in table or query
should be calculated in query
 Rather than included as data in table
•
Calculation types
 Predefined
• Compute amounts for groups of records or for all records
combined in query
 Custom
• Performs numeric date and text computations on each
record
• Using data from one or more fields
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
20
XP
Calculating Statistical Information
•
Aggregate functions
 Arithmetic and statistical operations
 Apply to records that meet query’s selection criteria
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
21
XP
Aggregate Functions
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
22
Using Aggregate Functions in XP
a
Query
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
23
Creating Calculated Fields in aXP
Query
•
Expression
 Arithmetic formula used to make calculation
 Use standard arithmetic operators
 Use parenthesis for complex expressions
•
Calculated field
 Add to query design grid
 Type expression
•
Expression builder
 Build complex expressions
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
24
Creating Calculated Fields in aXP
Query (continued)
•
Function
 Perform standard calculation
 Return value
•
Date()
 Provides today’s date
•
Field properties
 Change format and number of decimal places for
calculated field
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
25
XP
Field Properties
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
26
XP
Concatenating in Queries
•
Concatenation
 Combining contents of two or more fields
 Operator
• &
 Example
• Name [EmpFirst]& " " & [EmpLast]
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
27
XP
Level 2 Summary
•
•
Use queries to select data from more than one table
Join types
 Inner
 Right outer
 Left outer
•
Calculated field types
 Predefined
 Custom
Chapter 3
Succeeding in Business with Microsoft Office
Access 2003: A Problem-Solving Approach
28