Download presentation
Presentation is loading. Please wait.
Published byJunior Owens Modified over 8 years ago
1
MICROSOFT ACCESS – CHAPTER 3 CONTD. Sravanthi Lakkimsetty Sravanthi.lakkimsetty@mail.wvu.edu Mar 14, 2016.
2
REMINDER Homework # 4 on Microsoft Access is due on Friday, April 01 by 11.59 P.M.
3
TOTAL QUERIES “Totals” in a query can group field values and also perform basic computational functions on them To make the Total row appear, you need to click the Sigma symbol “Totals” button in query design view !
4
EXERCISE Go to the lecture notes page and Download Total_example.accdb.
5
PREMISE We are running an investment firm and have some consultants working for us who have clients for which they manage investments. We want a query that will show us how many clients each consultant has and the total amount of investments each consultant is handling… Save locally and open Total_example.accdb
6
STRUCTURE OF TABLES & RELATIONSHIP This Database has not yet had a relationship created. We will do it in the query for this one. Sometimes under special circumstances you will create them here instead of in the relationships window. Generally it is done in the relationships window though…
7
BUILDING THE TOTAL QUERY Create ribbon > Queries group > Query Design Add both tables Create relationship inside query by dragging ConsultantID fields together
8
BUILDING THE TOTAL QUERY Add the field [Consultants]LastName Add the field [Clients]LastName Add the field [Clients]Assets Run it without Total options > back to design view Click the button on the Query Tools / Design ribbon to insert a “Total:” row Note that the default for each is “Group By”
9
BUILDING THE TOTAL QUERY We will Group By the last name of the consultants to show each of them singularly We will Count the last names of the clients as they are tied to the consultants to show how many clients each has ! We will Sum the assets of the clients to show how much all clients of each consultant have together
10
SETTING UP THE TOTAL ROW Have [Consultants] LastName as Group By Have [Clients] LastName as Count Have Assets as Sum Run the Query !
11
ALIASING THE FIELD NAMES Sometimes for a Field, a Calculated field, or a Total field, we like to make the display name more specific in the query results To do this, simply change the field name in design view by adding a new name and an “:” An example for the clients LastName field: # of Clients: LastName
12
ALIAS THE 3 FIELDS IN DESIGN VIEW Consultant: LastName # Clients: LastName Total Assets: Assets Run the Query and note the field names in the dynaset !
13
DOING MULTIPLE THINGS TO 1 FIELD Sometimes you may need to do multiple total query-type actions to a single field. Download and open the file CSDemo.accdb from the site
14
BACKGROUND FOR TOTAL QUERY Look at the contents of the Sales table We want to display our: Number of sales Total dollar amount of sales Average dollar amount sale
15
CREATING THE TOTAL QUERY Create a new query in design view Add the Sales Table Add the Amount field 3 Times ! ! ! Click button to show the Total row Set them to Count, Sum, and Average Run it ! Close Access
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.