chapter extension 6 using excel and access together

63
Chapter Extension 6 Using Excel and Access Together

Upload: noel-stone

Post on 28-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter Extension 6 Using Excel and Access Together

Chapter Extension 6

Using Excel and Access Together

Page 2: Chapter Extension 6 Using Excel and Access Together

Q1: Why use Excel and Access together?

Q2: What is import/export?

Q3: How can you create graphs with Excel?

Q4: How can you create group totals in Access?

Q5: How can you use Excel to graph Access data?

Q6: How can you use Access to report Excel data?Q7: How can you combine Excel and Access to

analyze data?

Study Questions

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-2

Page 3: Chapter Extension 6 Using Excel and Access Together

Access is a DBMS for keeping track of things and creating reports

Excel is good for creating sophisticated graphs and mathematically analyzing data

Using together cuts labor and errors that re-keying data from one to other would create

Q1: Why Use Excel and Access Together?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-3

Page 4: Chapter Extension 6 Using Excel and Access Together

• Creates a temporary active or open connection to source data

• After data transferred, connection is closed

Import/Export:

Process of transferring data from

one system to another

Q2: What Is Import/Export?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-4

Page 5: Chapter Extension 6 Using Excel and Access Together

Comma-delimited text file

Tab character can be used instead of commas to create a tab-delimited file

Import/Export of Text Data

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-5

Page 6: Chapter Extension 6 Using Excel and Access Together

Step 1: Open a database, click on External Data tab

Step 2: Select file that contains data to import

• Click Import and OK

Step 3: Multiple-panel wizard opens

• Specify data file is delimited

Step 4: Name fields and their data type

Creating a Text File in Access

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-6

Page 7: Chapter Extension 6 Using Excel and Access Together

External Data Menu Choice

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-7

Page 8: Chapter Extension 6 Using Excel and Access Together

Importing Text Data into Access—Step 1

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-8

Page 9: Chapter Extension 6 Using Excel and Access Together

Importing Text Data into Access (a) Specifying a Delimited File—Step 2

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-9

Page 10: Chapter Extension 6 Using Excel and Access Together

Importing Text Data into Access (b) Specifying a Comma-delimited File—Step 3

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-10

Page 11: Chapter Extension 6 Using Excel and Access Together

Importing Text Data into Access (c) Naming & Describing Columns During Import—Step 4

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-11

Page 12: Chapter Extension 6 Using Excel and Access Together

Data After Import

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-12

Page 13: Chapter Extension 6 Using Excel and Access Together

Data from Computer Budget workbook (Chapter Extension 6) used for following examples

Pie chart

Column chart

Q3: How Can You Create Graphs with Excel?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-13

Page 14: Chapter Extension 6 Using Excel and Access Together

Creating the Pie Chart

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-14

Click Insert tab in the ribbon, and in Charts section of that ribbon select Pie icon

Page 15: Chapter Extension 6 Using Excel and Access Together

Sample Pie Chart

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-15

Page 16: Chapter Extension 6 Using Excel and Access Together

Creating a Column Chart

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-16

Page 17: Chapter Extension 6 Using Excel and Access Together

Sample Column Chart

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-17

Page 18: Chapter Extension 6 Using Excel and Access Together

Creating the Chart Title

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-18

To insert a title, click Column chart, select Chart Tools, click Layout tab, click Chart Title, and select Centered Overlay Title

Page 19: Chapter Extension 6 Using Excel and Access Together

Volunteer database from Chapter Extension 8 used in following examples

• Television station manager wants to know TotalDonations for each date of fundraising effort. Also wants to know if some dates are better than others.

• Using WORK table, create a query to group all donations by date and sum TotalDonations for each group

Scenario:

Q4: How Can You Create Group Totals in Access?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-19

Page 20: Chapter Extension 6 Using Excel and Access Together

Open Voluntee

r databas

e

Click Create tab

Click Quer

y Desig

n

Select WOR

K table

Click Add

Click Close

Q4: How Can You Create Group Totals in Access? (cont’d)

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-20

Page 21: Chapter Extension 6 Using Excel and Access Together

Selecting WORK Table for the Query

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-21

Page 22: Chapter Extension 6 Using Excel and Access Together

Adding Date and Totaldonations to the Query

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-22

Page 23: Chapter Extension 6 Using Excel and Access Together

Selecting Sum in Total Row for TotalDonations

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-23

To group WORK rows according to date, click Total button in Show/Hide section of Design tab. Access adds a row labeled Total to query contents table.

Page 24: Chapter Extension 6 Using Excel and Access Together

Results of Query with Group by Date

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-24

Page 25: Chapter Extension 6 Using Excel and Access Together

Double-click

Name to insert it

into query table

Double-click ProspectID

and TotalDonations to insert

into query table

Click Totals icon to

insert Total row in query

table

In Total row under ProspectID

, select Count

In Total row under

TotalDonations, select

Sum

Create a column heading

ProspectID column by

keying “Hours Worked:”

Create a column

heading for TotalDonations

as “Total Obtained:”

Steps for Creating a Query to Compute Total Hours and Donations for Each Prospect

1 2 3 4 5 6 7

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-25

Page 26: Chapter Extension 6 Using Excel and Access Together

Process for Creating a Query to Compute Total Hours and Donations for Each Prospect

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-26

Page 27: Chapter Extension 6 Using Excel and Access Together

Results of the Query in Previous Slide

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-27

Page 28: Chapter Extension 6 Using Excel and Access Together

Adding Average Donations Per Hour: Avg

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-28

Page 29: Chapter Extension 6 Using Excel and Access Together

Results of the Query In Figure CE9-17

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-29

Page 30: Chapter Extension 6 Using Excel and Access Together

Import an Access query into Excel and use Excel’s graphing capability to display results

• Click Data tab in the ribbon• Click Get External Data

section, select From Access• Select Volunteer database

To import data into

Excel:

Q5: How Can You Use Excel to Graph Access Data?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-30

Page 31: Chapter Extension 6 Using Excel and Access Together

Menu to Import Data from Access into Excel

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-31

Click Data tab in ribbon, then, in Get External Data section, select From Access

Page 32: Chapter Extension 6 Using Excel and Access Together

Selecting the Query to Import

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-32

Page 33: Chapter Extension 6 Using Excel and Access Together

Placing Imported Data into Spreadsheet

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-33

Page 34: Chapter Extension 6 Using Excel and Access Together

Spreadsheet with Imported Data

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-34

Page 35: Chapter Extension 6 Using Excel and Access Together

Formatted Imported Data

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-35

Page 36: Chapter Extension 6 Using Excel and Access Together

Bar Chart of the Imported Data

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-36

Click Insert tab, and select bar chart. Next, to insert a title, click Chart Tools, Layout, Chart Title, then Centered Overlay Title. Then type chart’s title.

Page 37: Chapter Extension 6 Using Excel and Access Together

1. We used Access to keep track of volunteers and their received donations , and to query and group data—all tasks for which Access is ideally suited.

2. Then, we imported that data into Excel and used Excel’s easy graphing capability to create charts.

Reflect on What We Have Done

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-37

Page 38: Chapter Extension 6 Using Excel and Access Together

1. You want to group all expenses for a given expense category and produce an expense total for it

2. You want to group all expenses for particular dates and produce an expense total for each date

Suppose you want to

produce two different

reports from this data

You can do both by importing Excel data into Access and using Access report generator

Q6: How Can You Use Access to Report Excel Data?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-38

Page 39: Chapter Extension 6 Using Excel and Access Together

Sample Expense Data

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-39

Page 40: Chapter Extension 6 Using Excel and Access Together

To create a named range for the expense data:

Highlight all data (including column headings) and then click Formulas tab

In Defined Names section, click Define Name and then enter a suitable name

Note: Range names cannot have any spaces, so use underscores

Creating a Named Range in Excel

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-40

Page 41: Chapter Extension 6 Using Excel and Access Together

Creating a Named Range

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-41

Highlight all of data (including column headings), then click Formulas tab. In Defined Names section, click Define Name and enter a suitable name

Page 42: Chapter Extension 6 Using Excel and Access Together

Close Excel

workbook that

has data

Open Access databas

e for importin

g

Click External Data tab, then click Excel in Import section

Click Import

source data into new table in current

database

Click OK

Next, click Show

Named Ranges,

select Event_Expe

nses

Check box for First

Row Contains Column Names

Importing Data in Named Range into a New Access Table

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-42

Page 43: Chapter Extension 6 Using Excel and Access Together

Importing an Excel Data into Access

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-43

Page 44: Chapter Extension 6 Using Excel and Access Together

Importing Excel Data into Access (a) Importing the Data in the Named Range

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-44

Page 45: Chapter Extension 6 Using Excel and Access Together

Importing Excel Data into Access (b) Access Has Metadata to Guide Import

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-45

Page 46: Chapter Extension 6 Using Excel and Access Together

After clicking Finish,

Access will create a table

with metadata

descriptions and place data into

Event_Expenses table

Open Event_Expens

es table

Click Create,

click Report in Reports section

Access generates a report that can

be modified to get a desired format

Creating Expense Reports

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-46

Page 47: Chapter Extension 6 Using Excel and Access Together

In Views section, click down arrow and select Design View. Click in unused part of this screen to deselect all columns.

Click ID in Page Header to give it focus. Then, press Delete. ID column will be removed.

Deselect and Delete Columns

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-47

Page 48: Chapter Extension 6 Using Excel and Access Together

Grouping Report Data by Expense Category

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-48

Page 49: Chapter Extension 6 Using Excel and Access Together

Creating Group Totals

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-49

Page 50: Chapter Extension 6 Using Excel and Access Together

Resulting Report

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-50

Page 51: Chapter Extension 6 Using Excel and Access Together

In Grouping & Totals section

of Design ribbon, click

Group & Sort. Bottom of report design window,

click Add a group

Click Expense Categor

y, as shown in

next figure

At bottom of Design window,

click More and click Expense totaled

Select Expense for Total On

and click Show Grand Total and Show in group footer

Report is finished

Q7: How Can You Combine Excel andAccess to Analyze Data?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-51

Page 52: Chapter Extension 6 Using Excel and Access Together

Creating a Query to Sum Expenses by Given Date

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-52

Page 53: Chapter Extension 6 Using Excel and Access Together

Merge EventDateTotals query with EventExpenseTotals queryClick Create/Query Design, then click Queries tab in Show Table window, as shown in next slide. (Figure CE9-34)Add both EventDateTotals and EventExpenseTotals to query.Drag Date field in EventDateTotals and drop on top of Event Date in EventExpenseTotals query. Add Date, SumOfTotalDonation, and Total Event Expense to query (Figure CE9-36)

Run (!) query to see results

Save query as Event Results and Expenses

Creating a Query to Combine Results of Two Other Queries

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-53

Page 54: Chapter Extension 6 Using Excel and Access Together

Combining the Results of Two Queries

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-54

Click Create/Query Design; click Queries tab in Show Table window; Add both EventDateTotals and EventExpenseTotals to query

Page 55: Chapter Extension 6 Using Excel and Access Together

Matching Date Values in Two Queries

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-55

Inform Access that Date values in two queries are the same by dragging Date field in EventDateTotals and dropping it on Event Date in EventExpenseTotals query

Page 56: Chapter Extension 6 Using Excel and Access Together

Query with Columns Added

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-56

Page 57: Chapter Extension 6 Using Excel and Access Together

Result of Query

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-57

Page 58: Chapter Extension 6 Using Excel and Access Together

Open a workbook in Excel and

import Event Results and Expenses

query

Click Data From Access in

Get External Data section of

ribbon

Select Access database with

query, and select Event Results and Expenses

Import Events Results and Expensesinto Excel

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-58

Page 59: Chapter Extension 6 Using Excel and Access Together

Query Imported into Excel

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-59

Page 60: Chapter Extension 6 Using Excel and Access Together

Imported into Excel

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-60

Expense data began as Excel data in Fund Raising Exp worksheet, then imported into Access, where it was summed. Results of Total Event Expense query were then imported back to Excel (here).

Page 61: Chapter Extension 6 Using Excel and Access Together

Total Donation data originated in Access and was summed using an Access query

Expense data from Excel worksheet Fund Raising Expense was imported into Access, where it was summed in a query

Results of Total Event Expense query were imported back to Excel, where it was analyzed as shown in the previous slide

Reflect on What Has Been Done with This Data

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-61

Page 62: Chapter Extension 6 Using Excel and Access Together

Active Review

Q1: Why use Excel and Access together?

Q2: What is import/export?

Q3: How can you create graphs with Excel?

Q4: How can you create group totals in Access?

Q5: How can you use Excel to graph Access data?

Q6: How can you use Access to report Excel data?

Q7: How can you combine Excel and Access to analyze data?

Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall CE9-62

Page 63: Chapter Extension 6 Using Excel and Access Together

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic,

mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Copyright © 2010 Pearson Education, Inc.  Publishing as Prentice Hall