access chapter 3-obtaining answers to your data questions

14
Access Chapter 3-Obtaining Answers to Your Data Questions

Upload: blaise-barker

Post on 14-Jan-2016

230 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Access Chapter 3-Obtaining Answers to Your Data Questions

Access

Chapter 3-Obtaining Answers to Your Data Questions

Page 2: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-2

Table Relationships

Defining and using table relationships is the way to combine related data

One to many Unique record from one table can have zero, one

or many related records in another table

Page 3: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-3

Table Relationships

Referential Integrity System of rules to ensure that relationships between

records in related tables are valid Prevents accidental deletion of or change to related data Use cascade updates and or cascade deletes to allow

automatic changes to related fields (is it good to use cascading? Depends on the situation)

Page 4: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-4

Querying Databases

Filters-datasheet tools to temporarily display set of records Filter by Selection Filter by Form Advanced Filter

Page 5: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-5

Querying Databases

Most common type- Select Query Asks a question about the data stored in

tables, only certain records meet the criteria and are selected

Page 6: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-6

Querying Databases

Query, Design View Query By Example (QBE) is the Access user

interface that creates SQL statements

Query, Datasheet View The display of the returned records Can be different each time the query is run

Page 7: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-7

Querying Databases

Creating queries is one of the most important skills in any database program

Queries are the basis for forms and reports Good form and report design is a result of

starting with a good query design

Page 8: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-8

Querying Databases

Sorting, Ascending or Descending Up to 10 fields, done from left to right

Show check box- determines if field is displayed in datasheet

Why needed? Set criteria for a field that you do not want displayed

Page 9: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-9

Querying Databases

Specifying Record Selection Criteria-learning to return just the records you need

Page 10: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-10

Querying Databases

Learn to formulate expressions, used in: Query criteria and calculated fields

And also: Table validation rules Form and report calculated controls VBA code SQL statements

Page 11: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-11

Querying Databases

Operators- key expression building tool Like, In, Between…And… =, <, >, <>

Exact matches Multiple criteria

And-tends to return fewer records Or-tends to return more records

Page 12: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-12

Querying Databases

Calculated Fields-derivable quantities that should not be stored (why?) in underlying table, such as: ExtendedPrice: Quantity * Price Age: DateDiff("yyyy",[DateOfBirth],Date())

Expression Builder-useful tool Zoom Box (Shift+F2)

Page 13: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-13

Querying Databases

Aggregate Functions-useful for gathering statistical information, watch “group by”

Page 14: Access Chapter 3-Obtaining Answers to Your Data Questions

PgP MIS 342 Access 3-14

Querying Databases

Group By-use in conjunction with aggregate functions or alone Consolidate records into groups based on chosen

fields