740 likes | 1.1k Views
Microsoft Office Access 2007 Lab 3. Querying Tables and Creating Reports. Objectives. Evaluate table design Establish relationships Enforce referential integrity Create and modify a simple query Query two tables. Objectives. Filter a query Find unmatched and duplicate records
E N D
Microsoft Office Access 2007Lab 3 Querying Tables and Creating Reports
Objectives • Evaluate table design • Establish relationships • Enforce referential integrity • Create and modify a simple query • Query two tables
Objectives • Filter a query • Find unmatched and duplicate records • Create a Parameter query • Create reports from tables and queries • Display a Totals row
Objectives • Modify a report design • Select, move, and size controls • Change paper margins • Preview and print a report • Compact and back up a database
Relationship Query Join Report Concept Preview
Outline • Filtering Records • Using Filter by Selection • Using Filter by Form
Outline • Querying a Database • Using a Query Wizard • Moving Columns • Modifying and Saving a Query • Creating a Query in Design View • Querying Two Tables • Finding Unmatched Records • Adding a Second Table to the Query
Outline • Creating a Report from a Table • Using the AutoReport Wizard • Using the Report Wizard • Modifying the Report Design • Selecting the Report Design • Moving Controls • Sizing Controls • Previewing the Report Layout
Outline • Creating a Report from a Query • Previewing and Printing Reports • Changing Page Margins • Printing an Entire Report • Printing a Selected Page of the Report • Compacting and Backing Up the Database
Outline • Key Terms • FAQs • Discussion Questions
Refining the Database • Once created, analyze your database for efficiency • There may be a better way to organize your table information • Is information repeated? • Are there any fields that need to be added? • Use the Access Table Analyzer to evaluate the design of your database
Concept 1 Relationship • Establishes the association between common fields in two tables • Related fields • Must be the same data type • Must contain the same kind of information • Can have different field names • Special exceptions for the AutoNumber data type
Deleting Relationships 2. Delete the Table 1. Remove Relationship
Querying a Database • A query is a request for specific data • Queries are used to … • View data in different ways • Analyze data and change existing data • Queries are based on tables
Concept 2 Query
Using a Query WizardSteps • Click Query Wizard in the Other group of the Create tab • Select resource table and fields • Enter a descriptive name for your query • Select how to display query results
Using Query Design View • Create or modify a query • Screen divided into two areas • Upper area contains the field list • Lower area displays the design grid
Adding a Second Table to the Query What do you call a query that uses results from two or more tables?
Concept 3 Join • An association between a field in one table or query and a field in another table or query • Must have at least one common field • Fields must be the same data type • Used to bring information from different tables together • Joins are what make relational databases so powerful
Adding Fields • These methods can be used to add fields to the query design grid • Select field name and drag • Double-click on the field names • Select the field drop-down arrow and choose field name • Select the asterisk in the field grid to include all fields
Specifying Criteria • A criteria expression will select only records that meet certain limiting criteria • Criteria can be entered in the Criteria row of the query in Design View • Not necessary to enter = (equal to) • Character strings are automatically enclosed in quotation marks
Finding Unmatched Records • Click in the Query Wizard in the Other group of the Create tab • Choose Find Unmatched Query Wizard
Displaying a Totals Row • Calculations that are performed on a range of data are called aggregate functions • Averages • Sums • Counts • Data type of field must be number, decimal, or currency • Count function can be used on all data types
Concept 4 Report • Professional-appearing output • Generated from tables or queries • Includes groups and summary information • Can create … • Formatted labels • Report titles • Headings • Design styles, layouts, and graphics