chapter extension 6 using excel and access together

Post on 28-Jan-2016

223 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

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

• 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

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

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

External Data Menu Choice

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

Importing Text Data into Access—Step 1

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

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

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

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

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

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

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

Data After Import

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

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

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

Sample Pie Chart

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

Creating a Column Chart

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

Sample Column Chart

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

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

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

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

Selecting WORK Table for the Query

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

Adding Date and Totaldonations to the Query

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

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.

Results of Query with Group by Date

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

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

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

Results of the Query in Previous Slide

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

Adding Average Donations Per Hour: Avg

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

Results of the Query In Figure CE9-17

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

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

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

Selecting the Query to Import

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

Placing Imported Data into Spreadsheet

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

Spreadsheet with Imported Data

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

Formatted Imported Data

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

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.

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

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

Sample Expense Data

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

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

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

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

Importing an Excel Data into Access

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

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

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

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

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

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

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

Grouping Report Data by Expense Category

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

Creating Group Totals

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

Resulting Report

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

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

Creating a Query to Sum Expenses by Given Date

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

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

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

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

Query with Columns Added

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

Result of Query

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

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

Query Imported into Excel

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

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).

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

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

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

top related