Accelerated Computer Training for Working Professionals Factory 2010 Case Orange Coast Database Associates Course (800)355-9855 or http://www.dhdursoassociates.com Orange Coast Database Associates Specializing in Microsoft Office, Access, SQL, and related technologies Classes custom designed forWorking Professionals http://www.dhdursoassociates.com San Juan Capistrano, CA (800)355-9855 AIN106 Introduction to Microsoft Access Reports and Analysis
AIN106 Microsoft Access Reporting and Analysis. This course emphasizes tables, data, queries and reports. It is designed for those who will be using Access primarily for decision support as opposed to data entry.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Accelerated Computer Training for Working Professionals Factory 2010 Case
Orange Coast Database Associates Course (800)355-9855 or http://www.dhdursoassociates.com
Orange CoastDatabase Associates
Specializing in Microsoft Office,
Access, SQL, and related technologiesClasses custom designed forWorking Professionals
http://www.dhdursoassociates.com
San Juan Capistrano, CA
(800)355-9855
AIN106 Introduction to MicrosoftAccess Reports and Analysis
Factory AIN1061
AIN106 - Introduction to Access
Quick introduction to Access forexperienced Windows users
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://[email protected]
FactoryAIN1062
AIN106 - Introduction to Access
Introduction (s) Facilities Course Materials (Varies by class)
– Student Questionnaire– PowerPoint handouts for all sessions– Evaluation form– Training certificate– Collaterals (Maps, Catalogs, etc.)
FactoryAIN1063
MS Access Introductory (100 Level)Standard Curriculum
AIN100
AIA101
AMP110Macros
AIN104Reports& Forms
AIN102Queries
AIN100T Incl. A & B
FactoryAIN1064
MS Access Introductory (100 Level)Specialized Curriculum
AIN100
TBDAIN106Reports
& Analysis
TBD
Incl. A & B
FactoryAIN106 V1.25
AIN106 – Introduction to Access
Quick pace for experienced windows users
Assumes no prior knowledge of Access
End-user, not programmer, oriented
Somewhat structured towards personal use foranalysis and reporting
FactoryAIN1066
AIN106 - Introduction to Access
Databases
Tables
Datasheet
External Data
Queries
Reports
Criteria Selection Forms
Course Topics:
FactoryAIN1067
Introduction to Access
Industry Standard Approach:
Tables Table Designer
Queries Query designer
Reports Wizard then modify
Forms Wizard then modify
Macros Macro Designer
Access has many ways to accomplish tasks. As an acceleratedcourse we will cover only the most common.
FactoryAIN1068
AIN106 - Introduction to Access
2 Sessions
Lecture
Demo
Student “hands-on” - by the end of theclass the student will have constructed asmall, functional application
Exercises are cumulative – later examplesbuild on objects created earlier
Course Format:
FactoryAIN1069
Database Design – Critical Topic
What do I want?– (Outputs - Reports)
What have I got?– (Inputs – Tables, Import data)
What do I need to do to getthere?
– (Processes, Queries)
FactoryAIN10610
Understand your database
Draw apicture
Write adescription
Plan yourqueries
PRODUCTS
EMPLOYEESC.C.Toys
ORDERS
Note: we have a full day course (DBD201) on this important topic.
FactoryAIN10611
AIN106 - Introduction to Access
Session 1– Tables and Data
– Starting Queries
Session 2– Queries
– Reports
– Criteria Selection Forms
Course Schedule (3 hour sessions):
Notes
FactoryAIN10612
Factory Access Introduction v1.021
Microsoft Access
Module
Introduction to Access, Tables andData
FactoryAccess Introduction v1.022
Module Outline
Part 1: Introduction & Tables
Part 2: Manipulating and Sorting Tables
Part 3: Table Relationships
Three parts:
FactoryAccess Introduction v1.023
Module Hands On
– Create a database based on Factory2000 case
– Create 3 tables (w/validation rulesand masks)
– Populate tables
– Sort & Manipulate tables
– Create table relationships (permanentlinks)
Students “hands-on”:
Factory Access Introduction v1.024
Introduction to Access
Module Part 1:
Introduction to Access and Tables
FactoryAccess Introduction v1.025
Access Modes
Menu-driven interface - Interact with a databaseand its objects using menu commands
Program mode - Lets you store instructions in a VBAprogram file
This course concentrates on the menu interface butdoes cover macros which can be used to “program” aseries of actions
FactoryAccess Introduction v1.026
Relational Database Concepts
Most prominent type of database – Access is aRelational Database
Based on set theory (Mathematically based) A table is a relation between columns and rows Each row must be unique Each column may contain only one type of data and
must have a unique name Each data element may contain only one value Information from multiple tables can be combined
using a column of common information
FactoryAccess Introduction v1.027
Database Terminology
Database – in Access an “.mdb” file in whichtables, reports, queries, and other objectsare stored
Table – stores facts about one subject(entity)
Record - contains related information aboutone entity “instance”
Field - contains a fact about an entity
FactoryAccess Introduction v1.028
Database Terminology (cont.)
Key - used to order, identify, and retrieve recordsin the database
Primary key - unique identifier for a particularrecord. Only one per table.
Index – Internal structure that speeds up searchesand joins. Also used to enforce uniqueness. Can haveseveral per table.
Table structure - the arrangement of informationwithin a record, the type of characters, fieldlength, limitations, etc.
FactoryAccess Introduction v1.029
Database Terminology (cont.)
Form - paper-like method of accessing and enteringdata in a table
Query – retrieves information from Access tables
Report - provides the ability to arrange table dataas well as to perform calculations and then print apaper-based report
Object – used in database world as generic term forqueries, reports, indexes, tables, etc. Not the sameas programming object.
FactoryAccess Introduction v1.0210
Sample Case – Factory2000
Implement a simple costaccounting application
Employees work on workorders
– Clock labor hours worked for eachwork order
– Only one labor ticket peremployee per work order
– Each work order has a standardtime budget
Some data periodicallyimported and/or exported
FactoryAccess Introduction v1.0211
Existing Method of RecordingFactory2000 Labor Hours
EmpNo fName lName Rate Wono Descr Hours
12 Bob Smith 15 A1 Casting 12
13 Mary Chavez 20 A1 Casting 22
14 Alicia Parks 25 B3 Ass’ly 15
14 Alicia Parks 25 C2 Screws 18
This what is called a “flat file”. What problems do you seewith this approach?
FactoryAccess Introduction v1.0212
Factory2000 Relational Database Structure
EmpNo fName lName Rate
12 Bob Smith 15
13 Mary Chavez 20
14 Alicia Parks 25
EmpNo Wono Start End Hours
12 A1 1/1/01 1/31/01 20
14 C2 2/1/01 2/28/01 42
14 B3 1/1/01 2/28/01 40
employees
Labor
Wono Descr Std
A1 Casting 30
B3 Fitting 50
C2 Screws 70
Work_orders
FactoryAccess Introduction v1.0213
Creating a Database
Ways to create a database
– Create a database using an Accesstemplate or Wizard – (not alwaysrecommended)
– Create a blank database and then insertyour own objects – we will use thismethod in this course
FactoryAccess Introduction v1.0214
Creating a Table
Click new from tables tab Naming a Table
– Up to 64 “standard” characters can be used– Do not use an extension– No leading spaces or control characters, in fact
try to avoid spaces altogether
Add fields one by one Set Field Properties in Field Properties
box
FactoryAccess Introduction v1.0215
Designing Fields
Field Type – text, datetime, number, etc.
Field Width – 10 characters, etc.
Caption – “Column title” for display
Format – Determines how the field is displayed(long date, short date, etc.)
Click toolbar key symbol to make primary key
Set indexed for secondary keys, required, etc.
FactoryAccess Introduction v1.0216
Table Designer
FactoryAccess Introduction v1.0217
Hands On - Create Table Structures
Employees
Work_Orders
Labor
FactoryAccess Introduction v1.0218
Employees Table Definition
EmpNo text(2), primary key
Fname text(10)
Lname text (15), required
Rate currency, required
MgrNo text(2)
Add captions, too
(Instructor led)
FactoryAccess Introduction v1.0219
Work_Orders Table Definition
WoNo text(2), primary key
Descr text(15)
StdHrs number(single,2), required
Accum number(single,2), required
Add captions, too
(On Your Own)
FactoryAccess Introduction v1.0220
Labor Table Definition
EmpNo text(2), primary key
WoNo text(2), primary key
Start datetime, required
End datetime
Hours number(single,2)
Add captions, too
(On Your Own)
FactoryAccess Introduction v1.0221
Field Validation & Masks
Add some validations
– Require start date
– End >= start date
– Etc.
Add some input masks & formats
FactoryAccess Introduction v1.0222
Datasheets
Datasheet window - displays the contents of a tablein a spreadsheet-like format
– Each row contains a record
– Each column contains a field
Speedbar - appears at the bottom of the windowand is used to navigate through the records in atable
FactoryAccess Introduction v1.0223
Datasheet View
FactoryAccess Introduction v1.0224
Entering & Editing Records
Enter table data from thehandouts
FactoryAccess Introduction v1.0225
Employees Table Data
FactoryAccess Introduction v1.0226
Work_Orders Table Data
FactoryAccess Introduction v1.0227
Labor Table Data
To be added later
Factory Access Introduction v1.0228
Introduction to Access
Module Part 2:
Manipulating and Sorting Tables
FactoryAccess Introduction v1.0229
Printing a Table
Access allows you to create “quick and dirty”reports by clicking the toolbar Print button
– A row/column presentation is used
– Field names appear along the top
– Records are rows
– Fields are columns
– A grid is printed around each field
FactoryAccess Introduction v1.0230
Quick Reports
Report Wizard
– Module 2 covers reports
– For now, be aware a quick report can beproduced using the report wizard
FactoryAccess Introduction v1.0231
Manipulating the Datasheet
Gridlines – controlled by Cells Effectsdialog box
Can control background color, fonts,etc.
Fields can be resized and moved
Also, hidden and locked like aspreadsheet
FactoryAccess Introduction v1.0232
Record Pointer
Record pointer (thick black arrow head) helps youkeep track of where you are in a table
The character is used in the left-hand table cellsto indicate the pointer location
The pointer moves by using keyboard, scrollbar, orspeedbar commands
=> Changes are saved when you move to next record
FactoryAccess Introduction v1.0233
Find Command
Use the Edit | Find command sequence orclick the Find toolbar button
Either command activates the Find in fielddialog box
Searches can have “Wildcards” (in factsophisticated Unix style searches are available)
FactoryAccess Introduction v1.0234
One Field Sort
Select the column to be used in the sort
Click the desired Sort Ascending orDescending toolbar button
FactoryAccess Introduction v1.0235
Multiple Field Sort
Filter - used to sort data or restrictrecords shown
Use Records | Filter | Advanced Filter/Sortcommand sequence
Activates the filter window
Specify the fields and sort order
Execute by clicking the Apply Filter/Sortbutton of the toolbar
Factory Access Introduction v1.0236
Introduction to Access
Module Part 3:
Table Relationships
FactoryAccess Introduction v1.0237
Relating Tables
Command sequence – Tools | Relationships
Parent table - table used as the main tablefor a relationship
Child table - the related table, often hasseveral records for each record in theparent table
FactoryAccess Introduction v1.0238
Referential Integrity
Orphan record - a child record without acorresponding parent record
Referential integrity - makes certain thatrelated records are present
FactoryAccess Introduction v1.0239
Table Links
In this context means relate two or moretables on columns of data
Permanent link –– established using the Relationships command
– is always in effect once defined; the wizards anddesigners will take advantage of this fact
Transient link - defined using the query-by-example feature of Access. Lasts for theduration of the query.
FactoryAccess Introduction v1.0240
Creating a Permanent Link
Drag fromPK to FK
FactoryAccess Introduction v1.0241
Create Permanent Links
Link all Factory2000 tables
Enforce referential integrity
Normal, default joins for now
FactoryAccess Introduction v1.0242
Permanent Links
FactoryAccess Introduction v1.0243
Enter Labor Table Data
Factory Access Introduction v1.0244
Introduction to Access
End of Module
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com
Factory Access Accel. Introduction v1.021
Introduction to Access
Module
Introduction to Access, ExternalData
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com
FactoryAccess Accel. Introduction v1.022
Module Outline
Topic 1: Export tables
Topic 2: Import data
Topic 3: Link tables
Three short topics:
FactoryAccess Accel. Introduction v1.023
Module Hands On
– Export work_orders and employees tables
– Import work_orders text file
– Link employees excel file
Students “hands-on”:
FactoryAccess Accel. Introduction v1.024
Sample Application – Factory2000
Simple cost accountingapplication
Employees work on workorders
Clock labor hours for eachwork order
FactoryAccess Accel. Introduction v1.025
Recording Factory2000 Labor Hours
EmpNo fName lName Rate Wono Descr Hours
12 Bob Smith 15 A1 Casting 12
13 Mary Chavez 20 A1 Casting 22
14 Alicia Parks 25 B3 Ass’ly 15
14 Alicia Parks 25 C2 Screws 18
What problems do you see with this approach?
FactoryAccess Accel. Introduction v1.026
Factory2000 Relational Database Structure
EmpNo fName lName Rate MgrNo
12 Bob Smith 15 13
13 Mary Chavez 20
14 Alicia Parks 25 12
EmpNo Wono Start End Hours
12 A1 1/1/01 1/31/01 20
14 C2 2/1/01 2/28/01 42
14 B3 1/1/01 2/28/01 40
employees
Labor
Wono Descr Std
A1 Casting 30
B3 Fitting 50
C2 Screws 70
Work_orders
FactoryAccess Accel. Introduction v1.027
Exporting a table
Very simple
Click File|Export (or save as)
Specify type: Access canexport to many types: Excel,Text, etc.
FactoryAccess Accel. Introduction v1.028
Exporting tables
Export Work_Orders to CSVtext file.
Export Employees to anExcel spreadsheet.
Note you can also export toanother Access table. Evenone elsewhere on a LAN!
FactoryAccess Accel. Introduction v1.029
Using External Data
Two methods:
– Import the data into a new (or existing table) in yourdatabase
– Link to the data. A table link appears in yourdatabase but the data stays in the original file.
FactoryAccess Accel. Introduction v1.0210
Importing Files
Another very important feature
Start from new table dialog, pickImport Table
It will start a wizard
Use advanced to select fields, etc.
Specifications can be saved for lateruse
FactoryAccess Accel. Introduction v1.0211
Importing a table from a Text File
Importing a Text File
FactoryAccess Accel. Introduction v1.0212
Importing from a text file
Import the instructor-suppliedlabor text file into the previouslycreated labor table
Save the specification
FactoryAccess Accel. Introduction v1.0213
Linking a table
Use new table dialog
Select Link Table
This will set up a connection to anexternal table. It does not becomepart of the Access database
Access can link to many types: Excel,ODBC connection, etc.
FactoryAccess Accel. Introduction v1.0214
Linking a table
Linking a Table
FactoryAccess Accel. Introduction v1.0215
Linking a table
Linking a Table
FactoryAccess Accel. Introduction v1.0216
Linking a table
Linking a Table
FactoryAccess Accel. Introduction v1.0217
Link a table
Link the EmployeesExcel
Give it a name likeEmployees_xls
Factory Access Accel. Introduction v1.0218
Introduction to Microsoft Access
[End of Module]
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com
Module
Introduction to Access, ExternalData
Notes
This slide intentionally left blank
19
Notes
This slide intentionally left blank
20
Factory Access - Accelerated Queries1
Microsoft Access
Module:
Queries
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com
FactoryAccess - Accelerated Queries2
Module Hands On
– Create a simple query
– Create a multi-table query
– Create calculated fields
– Create a summary query
– Concatenate fields
– Create a parameter query
Students “hands-on”:
FactoryAccess - Accelerated Queries3
Creating a Query
Activate the Create tab of the Databasewindow
Click the Query Design button
Interact with the dialog boxes
FactoryAccess - Accelerated Queries4
Query Results
Results placed in a dynaset in a window
Dynaset can be used like a regular table– Most useful when you work with fields
from several tables– Any changes that are made to a dynaset
field are also made to the originalrecord
FactoryAccess - Accelerated Queries5
Query Design Window
QBE grid - controls which fields appear inthe dynaset
Parts of the grid
– Field - contains the name of the field
– Table - contains the field’s table name
– Sort - controls the order of displayed data
– Show - displays a field in the dynaset
– Criteria - enter a condition to display selectedrecords
FactoryAccess - Accelerated Queries6
Criteria
Logical Comparison Operators– <, >, =, =<, >=. <>
Special Operators– LIKE
– IS NULL
– BETWEEN
– IN
Special characters– [ square brackets around names]
– (parentheses around function arguments)
– # pound sign around dates#
FactoryAccess - Accelerated Queries7
Like (“Wild Card Matches”)
ANSI standard
Wherecustomer_last_name like“Jo%”
Like “Jo_”
Microsoft Access
Wherecustomer_last_name like“Jo*”
Like “Jo?”
• * means match any string of characters; ? meansmatch one character.• Access actually allow more sophisticated Unix typesearch patterns as well – see help
FactoryAccess - Accelerated Queries8
Create a Simple Query
Use Work_Orders table
Show fields: all except accum
Sort by WoNo
Only records where descriptioncontains an “s”
Save your query as qrySimple
FactoryAccess - Accelerated Queries9
Simple Query (Find all records with an “S in the
description field)
Query by Example (QBE) Grid
FactoryAccess - Accelerated Queries10
Joining Tables
Tables can be joined for performing a query
– Must have a common field
– Linking in QBE grid performed via a dragoperation
– Join types: inner, left outer, right outer
– Use show tables dialog to bring up list of tables
FactoryAccess - Accelerated Queries11
Joining two TablesDrag fromPK to FK
Double Click tablename to add
FactoryAccess - Accelerated Queries12
Create a multi-table query
Join Labor and Employees
Show following fields: all from labor,fname, lname and rate fromemployees
Sort by empno then wono
Save your query as qryLaborDetail
FactoryAccess - Accelerated Queries13
Multi-table Query Design
FactoryAccess - Accelerated Queries14
Multi-table Query Results
FactoryAccess - Accelerated Queries15
Calculated Fields
Can embed calculations in a query
Creates a new temporary field whichappears in the dynaset
Store your calculations there
Can use an expression “builder” to help
FactoryAccess - Accelerated Queries16
Query with Calculated Field(use the builder)
FactoryAccess - Accelerated Queries17
Query with Calculated Field
Use qryLaborDetail
Add a calculated field whichshows the cost of a laborticket
Save your query asqryLaborDetail_2
FactoryAccess - Accelerated Queries18
Query with Calculated Field Results
FactoryAccess - Accelerated Queries19
Concatenated Fields
Can “add” two character fieldstogether
Use & operator
Example: fname & “ “ & lname
FactoryAccess - Accelerated Queries20
Concatenated Fields
Create a new labordetailquery
Add a column with theemployee’s full name
This can be used later inreports, etc.
Save your query asqryLaborDetail_3
FactoryAccess - Accelerated Queries21
Concatenated Fields Results
FactoryAccess - Accelerated Queries22
Summarizing Columns
SQL aggregate functions– Sum
– Count
– Avg
– Etc.
Activated by clicking the Total toolbar button
Adds a Total line to the QBE query grid
All selected columns must be in group by or anaggregate
FactoryAccess - Accelerated Queries23
Query with Aggregate
FactoryAccess - Accelerated Queries24
Query with Aggregate
Modify qryLaborDetail2
Drop work order fields
Sum the hours and cost
Save your query asqryLaborGrouped
FactoryAccess - Accelerated Queries25
Query with Aggregate Results
FactoryAccess - Accelerated Queries26
Parameter Queries
Accept a variable when run
Order Noparameter
FactoryAccess - Accelerated Queries27
Parameter Queries
Create a parameter query
Base on qryLaborDetail_3
Show all fields
Prompt for order no
Save as qryParam
FactoryAccess - Accelerated Queries28
Parameter Query Results
Factory Access - Accelerated Queries29
Accelerated Introduction to Access
End of Module
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.d2associates.com
Notes
This slide intentionally left blank
FactoryAccess - Accelerated Queries30
Notes
This slide intentionally left blank
FactoryAccess - Accelerated Queries31
Notes
This slide intentionally left blank
FactoryAccess - Accelerated Queries32
Factory Access - Automating Tasks1
Module - Advanced Queries
P.O. Box 6142Laguna Niguel, CA 92607949-489-1472http://www.dhdursoassociates.com
Microsoft Access
FactoryAccess - Automating Tasks2
Module Outline
Part 1: Advanced Queries
One part:
FactoryAccess - Automating Tasks3
Module Hands On
– Create action queries
Maketable
Append
Delete
Update
Students “hands-on”:
FactoryAccess - Automating Tasks4
MS Access Training
Part 1Advanced Queries
FactoryAccess - Automating Tasks5
Advanced Queries
Several types of special-use queries– Action
Make table*
Append*
Delete*
Update
– Other Pass-through, crosstab etc.
We will cover those with an *; others as time andinterest permit
Reached through Query menu bar when querydesigner is open
FactoryAccess - Automating Tasks6
FactoryAccess - Automating Tasks7
MakeTable Query
Allows you to create a new table based ona query
Can be output to current database oranother one
Very simple
– Design your query as you normally would
– Pull down the query menu and select maketable. Assign the new table name
FactoryAccess - Automating Tasks8
MakeTable Query
Create an extract of theEmployees table
– Save table as Temp_Employees
– Select MgrNo = 13
– Save your query asqryMake_Temp_Employees
FactoryAccess - Automating Tasks9
MakeTable Query Results
FactoryAccess - Automating Tasks10
Append Query
Appends records to an existing table
Design query then pull down query menu andselect table to append to
Must indicate destination field for each sourcefield in query. This is done in a new QBE gridrow.
Can have additional “criteria” fields with nodestination
FactoryAccess - Automating Tasks11
FactoryAccess - Automating Tasks12
Append Query
Create and execute an append query
Select from Employees all recordswith MgrNo =12
Append to table Temp_Employees
Save the query asqryAppend_Temp_Employees
FactoryAccess - Automating Tasks13
Append Query Results
FactoryAccess - Automating Tasks14
Delete Query
Deletes records from an existing table
Go to query design window then pulldown query menu and select table todelete from
Establish the criteria in the criteria row
FactoryAccess - Automating Tasks15
Delete Query
Delete from temp_employees
– All records with rate less than 20
FactoryAccess - Automating Tasks16
Delete Query Results
FactoryAccess - Automating Tasks17
Other Advanced Queries
Union – “Adds” results of two queries into one result