Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu Access chapters 3&5 Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu 1/18/2019.

Slides:



Advertisements
Similar presentations
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Advertisements

Microsoft Office 2007 Access Chapter 2 Querying a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Querying a Database Using the Select Query Window.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
Querying a Database Using the Select Query Window
Querying a Database Microsoft Office Access 2003.
Chapter 2 Querying a Database
Chapter 2 Querying a Database
Chapter 3 Maintaining a Database
XP New Perspectives on Microsoft Access 2002 Tutorial 41 Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
DAY 20: MICROSOFT ACCESS – CHAPTER 3 CONTD. Aliya Farheen March 19, 2015.
Lesson 31: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Design.
Microsoft Access 2010 Building and Using Queries.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Microsoft Office 2007 Access Chapter 2 Querying a Database.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a.
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Concepts of Database Management Seventh Edition
DAY 19: MICROSOFT ACCESS – CHAPTER 3 CONTD. Aliya Farheen March 17, 2015.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
ACCESS (CHAPTER 2-3 continued) Naman Kohli October 16,
The Advantage Series © 2004 The McGraw-Hill Companies, Inc. All rights reserved Creating Select Queries Chapter 6 Microsoft Office Access 2003.
T7-1 LEARNING OUTCOMES – ACCESS PROBLEM SOLVING 1.Describe the process of using the Simple Query Wizard using Access 2.Describe the process of using the.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
1 11 Exploring Microsoft Office Access 2007 Chapter 6 Data Protection.
Microsoft® Excel Create an Excel table. 1 Work with the Table Tools Design tab. 2 Sort and filter records in a table. 3 Identify structured references.
DAY 18: MICROSOFT ACCESS – CHAPTER 3 CONTD. Akhila Kondai October 21, 2013.
Microsoft Access Lesson 5 Lexington Technology Center February 25, 2003 Bob Herring On the Web at
ACCESS 3. OBJECTIVES Calculated fields in query design Total option in query design Creating Forms.
Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
ACCESS PROJECT TWO. PROJECT ONE In project one you: -Created Tables -Created Forms -Created Reports In this project you will learn about queries. Databases.
MICROSOFT ACCESS – CHAPTER 3 CONTD. Sravanthi Lakkimsetty Mar 09, 2016.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
MICROSOFT ACCESS – CHAPTER 3 CONTD. Sravanthi Lakkimsetty Mar 14, 2016.
Maintaining a Database
Microsoft Office Illustrated Introductory, Windows Vista Edition
Access Chapter 2 Querying a Database.
Plug-In T7: Problem Solving Using Access 2007
Querying a Database Using the Select Query Window
Larry Reaves October 9, 2013 Day 16: Access Chapter 2 Larry Reaves October 9, 2013.
Creating and Using a Database
Access Maintaining and Querying a Database
Building and Using Queries
Microsoft Office Access 2003
Day 17: MICROSOFT ACCESS – CHAPTER 2 Contd
Navya Thum March 04, 2013 Microsoft ACCESS Navya Thum March 04, 2013.
Tutorial 3 – Querying a Database
CIS16 Application Programming with Visual Basic
Exploring Microsoft Access 2003
Microsoft Office Access 2003
Access: Queries IV Participation Project
Access: Queries II Participation Project
Introduction to Access
Introduction To ACCESS DataBase
Nagendra Vemulapalli Access chapters 3&6 Nagendra Vemulapalli
Access: Reports Participation Project
Microsoft Office Illustrated Introductory, Windows XP Edition
Lesson 13 Working with Tables
Nagendra Vemulapalli Access chapters 1&2 Nagendra Vemulapalli
Assignment 3 Querying and Maintaining a Database
New Perspectives on Microsoft
Presentation transcript:

Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu Access chapters 3&5 Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu 1/18/2019

Reports Let us put things into a visually professional format suitable for printing Creation can be somewhat like doing Forms with Subforms… 1/18/2019

Reports Open the File Music.Accdb Create ribbon > Reports Group > Report Wizard Add these fields: [Bands] Band Name [Members] FirstName,LastName, Instrument, Living [Countries] Country 1/18/2019

Reports Click Next 3 times Sort Ascending by LastName and then FirstName Click Next 2 times Select any style you like Click “Finish” To Change any of the column widths in Report Right Click and Select Layout View Drag the fields to resize!! 1/18/2019

Exercise Go to the lecture notes page and Download Music_extended.accdb Note the added records to complete the English band Def Leppard and also the addition of the Canadian band Rush… 1/18/2019

Exercise Create a new query in design view Add 3 tables: Bands, Countries, & Members… 1/18/2019

Specify an Exact Match Condition An exact match condition only shows records that match your criteria in the “Criteria” row of the query design grid The field values of the records for the field the criteria is specified in must match the condition exactly to be shown in the query results 1/18/2019

Exercise Add the following fields from these tables: [Bands] BandName [Member] FirstName, LastName [Countries] Country Run the Query to see the unrestricted results of all the 16 records 1/18/2019

Adding Criteria Return to Design View In the criteria row for Country, type England to have it show us a Dynaset with only band members from England Rerun the query Change England to America and rerun Try Portugal to see that nothing returns! 1/18/2019

Using Comparison Operators… “And” / “Or” When using multiple conditions for a query, you can use the logical operators to combine conditions The “And” logical operator specifies that both conditions must be met The “Or” logical operator specifies that one or the other of the conditions must be met 1/18/2019

Using “And” and “Or” When you enter two conditions in the same row of the query design grid, an “And” condition is created If you enter two conditions that are on separate rows, an “Or” condition is created 1/18/2019

Illustration of “And” & “Or” Logic 1/18/2019

Creating “And” Condition in the Design Grid… 1/18/2019

Let’s Try an “And” Clear any existing criteria Add the field [Members] Living Type England in the Country row and create the AND condition by placing Yes in the Living row to return all living band members from England Run it Go back and change Yes to No and rerun 1/18/2019

Let’s do an “Or” Remove the old criteria We will set the criteria to show all members from Rush OR anyone from any band that is living at all from the list of members… First lets put “Rush” in the [Bands] Name field and run to see the results 1/18/2019

Create the “OR” We wish to not only see the members of Rush, but also in addition to them, anyone that might be alive in the members table. In Design view, type “Yes” in the OR row for [Members] Living You should now see a list of 10 additional records (13 total) 1/18/2019

Sorting Results by Data Type… 1/18/2019

Sort Exercise Open the RockTrivia Query in Design View In the Sort row for the BandName field, have it sort the records in Ascending Order Run the Query 1/18/2019

Two-Level Sort Leave the existing sort in place and move the last name field so that it is before the first name field in the Design view… Click once to select it… let go and then click and drag to move it over Add a secondary sort by having it do Last Name in Ascending order Run it. Last names are now show alphabetically inside the band names 1/18/2019

We can also use “Wildcards” 1/18/2019

Wildcard Example We want to see all members whose last names begin with “E”… Remove all existing sort options In the last name field, type the letter E in Criteria and run the query. (No results show as no one has just the letter E for a last name) Make it read E* and rerun to get any other characters… 1/18/2019

Wildcards continued Change the criteria to show people whose last names end in “N” *N Run it and we should see 6 records. Remove all criteria. 1/18/2019

Using Fields without Showing It is possible to use a field in searching but not show that field in the query results Let’s say we want to see all band members whose bands begin and end in “d”, but not see the band name Remove the “Show” row checkmark for BandName Create the criteria and run ! 1/18/2019

Operators Note: This technique is similar to what part of a query asks for in HW4 ! 1/18/2019

Date Field Entries for Birthday Note Born field in Members table is completed Close Members table 1/18/2019

Criteria & Operators Exercise Go to Design view for RockTrivia, add the Born field, and clear criteria, re-show BandName In the criteria row for born, add: >1/1/1960 Note we get 3 records Try making it: >=1/1/1950 AND <=1/1/1960 We get 9 Records Change it to: <1/1/1960 We get 13 records 1/18/2019

Calculations in a Query… Mathematical calculation can be done as part of the query.. We often do this for things that we do not need to store and take up space with Expressions can be entered into the query design grid as if they were regular fields Done on data type fields treated as numbers 1/18/2019

Calculations in a Query… To perform a calculation in a query, you must created a calculated field in query design. Make certain that you are following the rules of precedence !(Please Excuse My Dear Aunt Sally) Two options for entering expressions: Enter the expression directly into the field text box Enter the expression in the Expression Builder 1/18/2019

Creating a Calculated Field Remove the existing criteria Click in the next available blank field where the name would be, and then click the magic wand “Builder” icon above The expression builder shows up… 1/18/2019

The Expression Builder… 1/18/2019

Let’s make a Query to try this… Download and Open Music_extended.accdb We want to figure out how many years they are/would be alive. It would be inefficient to store this and we would have to update it all the time too ! Build or type the following: Age: (Date()-[Members]![Born])/365 Note: If you see <<expr>> be sure to remove it ! ! ! Run it ! Expand the width of the column if you see #### 1/18/2019

Changing Decimals Precision Note: Similar to what is needed for to set decimal places on query results in homeworks!! YOU MUST RUN THE QUERY ONCE FIRST ! In design view, right click Age field Click Properties Select Fixed for Format and 0 for Decimal Places Re-run it to see it without the decimal places 1/18/2019

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 ! 1/18/2019

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 1/18/2019

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… 1/18/2019

Building the Total Query Create ribbon > Other group > Query Design Add both tables Create relationship inside query by dragging ConsultantID fields together 1/18/2019

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” 1/18/2019

Building the Total Query We will Group By the last name of the consults 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 ! (Yes, kind of cool) We will Sum the assets of the clients to show how much all clients of each consultant have together 1/18/2019

Setting up the Total Row Have [Consultants] LastName as Group By Have [Clients] LastName as Count Have Assets as Sum Run the Query ! 1/18/2019

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 1/18/2019

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 ! 1/18/2019