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.

Slides:



Advertisements
Similar presentations
Microsoft Access 2010 Chapter 2 Querying a Database.
Advertisements

Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Chapter 5 Creating, Sorting, and Querying a Table
Microsoft Office 2007 Access Chapter 4 Creating Reports and Forms.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Chapter 1 Databases and Database Objects: An Introduction
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
Microsoft Office 2007 Access Integration Feature Sharing Data Among Applications.
Querying a Database Using the Select Query Window
Staff Development Daze June 27 & 28 Tony Gauvin. 2 Schedule  Monday June 27  Monday June 27  9:00 – 12:00 Basic Excel  12:00 – 1:00 Lunch for all.
Staff Development Daze June 27 & 28 Tony Gauvin. Schedule  Monday June 27  Monday June 27  9:00 – 12:00 Basic Excel  12:00 – 1:00 Lunch for all workshop.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Excel Project 1 Creating a Worksheet and an Embedded Chart.
Querying a Database Microsoft Office Access 2003.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 3 Maintaining a Database Using the Design and Update Features of Access.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Web Feature Sharing Data among Applications.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 4 Reports, Forms, and Combo Boxes.
Chapter 2 Querying a Database
Chapter 3 Maintaining a Database
Microsoft Office 2007 Access 2007 Chapter 9 Administering a Database System.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Advanced Form Techniques
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Excel Project 5 Creating, Sorting, and Querying a List.
Chapter 1 Databases and Database Objects: An Introduction
Using Form Tools and Creating Custom Forms Microsoft Access 2010.
Chapter 6 Advanced Report Techniques
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Web Feature Data Access Pages.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Office 2007 Access 2007 Chapter 7 Advanced Report Techniques.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Switchboards, PivotTables, and PivotCharts.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Office 2007 Access Chapter 2 Querying a Database.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
Querying a Database Access Project 2. 2 What is a Query?  In general, a query is a form of questioning, in a line of inquiry. A query may also refer.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
1 After completing this lesson, you will be able to: Create and run a query. Specify criteria in a query. Create a calculated field. Create a multiple-table.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Creating an Application System Using Macros, Wizards, and the Switchboard.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
Modify Tables and FieldsModify Tables and Fields Lesson 4 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft.
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.
ACCESS PROJECT TWO. PROJECT ONE In project one you: -Created Tables -Created Forms -Created Reports In this project you will learn about queries. Databases.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Office XP Introductory Concepts and Techniques Windows XP Edition M i c r o s o f t Excel Project 1 Creating a Worksheet and Embedded Chart.
Integrating Office 2003 Applications and the World Wide Web
Using Macros, Switchboards, PivotTables, and PivotCharts
Maintaining a Database Using the Design and Update Features of Access
Maintaining a Database
Creating a Worksheet and an Embedded Chart
Microsoft Office Illustrated Introductory, Windows Vista Edition
Access Chapter 2 Querying a Database.
Querying a Database Using the Select Query Window
Access SQL Feature Using SQL.
Sharing Data among Applications
Access Project 8 Using Visual Basic for Applications (VBA) and Creating Multi-Page Forms.
Creating and Using a Database
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms
Access Chapter 5 Multi-Table Forms.
Chapter 7 Advanced Form Techniques
Creating Reports and Forms
Advanced Report Techniques
Defining the Fields in a Table
Microsoft Office Illustrated Introductory, Windows XP Edition
Presentation transcript:

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

Access Project 2: Querying a Database Using the Select Query Window 2 Objectives Create and run queries Print query results Include fields in the design grid Use text and numeric data in criteria

Access Project 2: Querying a Database Using the Select Query Window 3 Objectives Create and use parameter queries Save a query and use the saved query Use compound criteria in queries Sort data in queries

Access Project 2: Querying a Database Using the Select Query Window 4 Objectives Join tables in queries Perform calculations in queries Use grouping in queries Create crosstab queries

Access Project 2: Querying a Database Using the Select Query Window 5 Opening the Database Click the Start button on the Windows taskbar, point to All Programs on the Start menu, point to Microsoft Office on the All Programs submenu, and then click Microsoft Office Access 2003 on the Microsoft Office submenu If the Access window is not maximized, double- click its title bar to maximize it If the Language bar appears, right-click it and then click Close the Language bar on the shortcut menu

Access Project 2: Querying a Database Using the Select Query Window 6 Opening the Database Click the Open button on the Database toolbar Click the Look in box arrow and then click USB flash drive Click Ashton James College Click the Open button in the Open dialog box

Access Project 2: Querying a Database Using the Select Query Window 7 Creating a Query Be sure the Ashton James College database is open, the Tables object is selected, and the Client table is selected Click the New Object button arrow on the Database toolbar Click Query With Design View selected, click the OK button Maximize the Query1 : Select Query window by double-clicking its title bar, and then drag the line separating the two panes to the approximate position shown on the next slide

Access Project 2: Querying a Database Using the Select Query Window 8 Creating a Query Drag the lower edge of the field box down far enough so all fields in the Client table are displayed

Access Project 2: Querying a Database Using the Select Query Window 9 Including Fields in the Design Grid If necessary, maximize the Query1 : Select Query window containing the field list for the Client table in the upper pane of the window and an empty design grid in the lower pane Double-click the Client Number field in the field list to include it in the query Double-click, the Name field to include it in the query, and then double-click the Trainer Number field to include it as well

Access Project 2: Querying a Database Using the Select Query Window 10 Including Fields in the Design Grid

Access Project 2: Querying a Database Using the Select Query Window 11 Running a Query Click the Run button on the Query Design toolbar

Access Project 2: Querying a Database Using the Select Query Window 12 Returning to the Select Query Window Click the View button arrow on the Query Datasheet toolbar Click Design View

Access Project 2: Querying a Database Using the Select Query Window 13 Closing a Query Click the Close Window button for the Query1 : Select Query window Click the No button in the Microsoft Office Access dialog box

Access Project 2: Querying a Database Using the Select Query Window 14 Including All Fields in a Query Be sure you have a maximized Query1 : Select Query window with resized upper and lower panes, an expanded field list for the Client table in the upper pane, and an empty design grid in the lower pane Double-click the asterisk at the top of the field list Click the Run button Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window

Access Project 2: Querying a Database Using the Select Query Window 15 Including All Fields in a Query

Access Project 2: Querying a Database Using the Select Query Window 16 Clearing the Design Grid Click Edit on the menu bar Click Clear Grid

Access Project 2: Querying a Database Using the Select Query Window 17 Using Text Data in a Criterion One by one, double-click the Client Number, Name, Amount Paid, and Current Due fields to add them to the query Click the Criteria row for the Client Number field and then type CP27 as the criterion Click the Run button to run the query

Access Project 2: Querying a Database Using the Select Query Window 18 Using Text Data in a Criterion

Access Project 2: Querying a Database Using the Select Query Window 19 Using a Wildcard Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window If necessary, click the Criteria row below the Client Number field Use the DELETE or BACKSPACE key as necessary to delete the current entry (CP27) Click the Criteria row below the Name field Type Fa* as the criterion

Access Project 2: Querying a Database Using the Select Query Window 20 Using a Wildcard Click the Run button to run the query If instructed to do so, print the results by clicking the Print button on the Query Datasheet toolbar

Access Project 2: Querying a Database Using the Select Query Window 21 Using Criteria for a Field Not Included in the Results Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Click Edit on the menu bar and then click Clear Grid Include the Client Number, Name, Address, Amount Paid, and City fields in the query Type Lake Hammond as the criterion for the City field

Access Project 2: Querying a Database Using the Select Query Window 22 Using Criteria for a Field Not Included in the Results Click the Show check box to remove the check mark Click the Run button to run the query If instructed to do so, print the results by clicking the Print button

Access Project 2: Querying a Database Using the Select Query Window 23 Creating and Running a Parameter Query Click the View button on the Query Datasheet toolbar to return to the Query1: Select Query window Erase the current criterion in the City column, and then type [Enter City] as the new criterion Click the Run button to run the query Type Tallmadge in the Enter City text box and then click the OK button

Access Project 2: Querying a Database Using the Select Query Window 24 Creating and Running a Parameter Query

Access Project 2: Querying a Database Using the Select Query Window 25 Saving a Query Click the Close Window button for the Query1 : Select Query window containing the query results Click the Yes button in the Microsoft Office Access dialog box when asked if you want to save the changes to the design of the query Type Client-City Query in the Query Name text box Click the OK button to save the query

Access Project 2: Querying a Database Using the Select Query Window 26 Saving a Query

Access Project 2: Querying a Database Using the Select Query Window 27 Using a Saved Query Click Queries on the Objects bar, and then right-click Client-City Query Click Open on the shortcut menu, type Tallmadge in the Enter City text box, and then click the OK button Click the Close Window button for the Client-City Query : Select Query window containing the query results

Access Project 2: Querying a Database Using the Select Query Window 28 Using a Saved Query

Access Project 2: Querying a Database Using the Select Query Window 29 Using a Number in a Criterion Click the Tables object on the Objects bar and ensure the Client table is selected Click the New Object button arrow on the Database toolbar, click Query, and then click the OK button in the New Query dialog box Drag the line separating the two panes to the approximate position shown on the following slide, and drag the lower edge of the field box down far enough so all fields in the Client table appear

Access Project 2: Querying a Database Using the Select Query Window 30 Using a Number in a Criterion

Access Project 2: Querying a Database Using the Select Query Window 31 Using a Number in a Criterion Include the Client Number, Name, Amount Paid, and Current Due fields in the query Type 0 as the criterion for the Current Due field. You should not enter a dollar sign or decimal point in the criterion Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 32 Using a Number in a Criterion

Access Project 2: Querying a Database Using the Select Query Window 33 Using a Comparison Operator in a Criterion Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Erase the 0 in the Current Due column Type >20000 as the criterion for the Amount Paid field. Remember that you should not enter a dollar sign, a comma, or a decimal point in the criterion Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 34 Using a Comparison Operator in a Criterion

Access Project 2: Querying a Database Using the Select Query Window 35 Using a Compound Criterion Involving AND Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Include the Trainer Number field in the query Type 48 as the criterion for the Trainer Number field Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 36 Using a Compound Criterion Involving AND

Access Project 2: Querying a Database Using the Select Query Window 37 Using a Compound Criterion Involving OR Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window If necessary, click the Criteria entry for the Trainer Number field and then use the BACKSPACE key or the DELETE key to erase the entry (“48”) Click the or row (below the Criteria row) for the Trainer Number field and then type 48 as the entry Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 38 Using a Compound Criterion Involving OR

Access Project 2: Querying a Database Using the Select Query Window 39 Sorting Data in a Query Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Click Edit on the menu bar and then click Clear Grid Include the City field in the design grid Click the Sort row below the City field, and then click the Sort row arrow that appears Click Ascending

Access Project 2: Querying a Database Using the Select Query Window 40 Sorting Data in a Query Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 41 Omitting Duplicates Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Click the second field in the design grid. You must click the second field or you will not get the correct results and will have to repeat this step Click the Properties button on the Query Design toolbar Click the Unique Values property box, and then click the arrow that appears to produce a list of available choices for Unique Values Click Yes and then close the Query Properties sheet by clicking its Close button

Access Project 2: Querying a Database Using the Select Query Window 42 Omitting Duplicates Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 43 Sorting on Multiple Keys Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Click Edit on the menu bar and then click Clear Grid Include the Client Number, Name, Trainer Number, and Amount Paid fields in the query in this order Select Ascending as the sort order for both the Trainer Number field and the Amount Paid field

Access Project 2: Querying a Database Using the Select Query Window 44 Sorting on Multiple Keys Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 45 Creating a Top-Values Query Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Click the Top Values box on the Query Design toolbar, and then type 4 as the new value Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 46 Creating a Top-Values Query Close the query by clicking the Close Window button for the Query1 : Select Query window When asked if you want to save your changes, click the No button

Access Project 2: Querying a Database Using the Select Query Window 47 Joining Tables With the Tables object selected and the Trainer table selected, click the New Object button arrow on the Database toolbar Click Query, and then click the OK button Drag the line separating the two panes so that it is 60% from the top of the window, and then drag the lower edge of the field list box down far enough so all fields in the Trainer table appear Click the Show Table button on the Query Design toolbar Be sure the Client table is selected, and then click the Add button

Access Project 2: Querying a Database Using the Select Query Window 48 Joining Tables Close the Show Table dialog box by clicking the Close button Expand the size of the field list so all the fields in the Client table appear Include the Trainer Number, Last Name, and First Name fields from the Trainer table as well as the Client Number and Name fields from the Client table Select Ascending as the sort order for both the Trainer Number field and the Client Number field

Access Project 2: Querying a Database Using the Select Query Window 49 Joining Tables Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 50 Changing Join Properties Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Right-click the middle portion of the join line (the portion of the line that is not bold) Click Join Properties on the shortcut menu Click option button 2 to include all records from the Trainer table regardless of whether or not they match any clients Click the OK button

Access Project 2: Querying a Database Using the Select Query Window 51 Changing Join Properties Click the OK button Run the query by clicking the Run button If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 52 Restricting the Records in a Join Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Add the Amount Paid field to the query Type >20000 as the criterion for the Amount Paid field and then click the Show check box for the Amount Paid field to remove the check mark Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 53 Restricting the Records in a Join

Access Project 2: Querying a Database Using the Select Query Window 54 Using a Calculated Field in a Query Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Right-click any field in the Client table field list Click Remove Table on the shortcut menu to remove the Client table from the Query1 : Select Query window Click Edit on the menu bar and then click Clear Grid. Include the Trainer Number, Last Name, Hourly Rate, and YTD Earnings Right-click the Field row in the first open column in the design grid

Access Project 2: Querying a Database Using the Select Query Window 55 Using a Calculated Field in a Query Click Zoom on the shortcut menu Type Hours Worked:[YTD Earnings]/[Hourly Rate] in the Zoom dialog box that appears Click the OK button Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 56 Using a Calculated Field in a Query

Access Project 2: Querying a Database Using the Select Query Window 57 Changing a Format and a Caption Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window If necessary, click the Hours Worked field in the design grid, and then click the Properties button on the Query Design toolbar Click the Format box, click the Format box arrow, and then click Fixed Click the Decimal Places box, and then type 1 as the number of decimal places Close the Field Properties sheet by clicking its Close button

Access Project 2: Querying a Database Using the Select Query Window 58 Changing a Format and a Caption Click the Hourly Rate field in the design grid, and then click the Properties button on the Query Design toolbar Click the Caption box, and then type Rate as the caption Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 59 Changing a Format and a Caption Click the Close Window button for the Query1 : Select Query window When asked if you want to save your changes, click the No button

Access Project 2: Querying a Database Using the Select Query Window 60 Calculating Statistics With the Tables object selected and the Client table selected, click the New Object button arrow on the Database toolbar Click Query, and then click the OK button Drag the line separating the two panes so that it is about 60% from the top of the window, and then drag the lower edge of the field list box down far enough so all fields in the Client table appear Click the Totals button on the Query Design toolbar, and then double-click the Amount Paid field Click the Total row in the Amount Paid column, and then click the row arrow that appears

Access Project 2: Querying a Database Using the Select Query Window 61 Calculating Statistics Click Avg Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 62 Using Criteria in Calculating Statistics Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Include the Trainer Number field in the design grid Produce the list of available options for the Total row entry just as you did when you selected Avg for the Amount Paid field Use the vertical scroll bar to move through the options until the Where option appears Click Where

Access Project 2: Querying a Database Using the Select Query Window 63 Using Criteria in Calculating Statistics Type 42 as the criterion for the Trainer Number field Click the Run button to run the query If instructed to print the results, click the Print button

Access Project 2: Querying a Database Using the Select Query Window 64 Using Grouping Click the View button on the Query Datasheet toolbar to return to the Query1 : Select Query window Click Edit on the menu bar and then click Clear Grid Include the Trainer Number field Include the Amount Paid field, and then click Avg as the calculation in the Total row Click the Run button to run the query

Access Project 2: Querying a Database Using the Select Query Window 65 Using Grouping If instructed to print the results, click the Print button Close the query by clicking the Close Window button for the Query1 : Select Query window When asked if you want to save your changes, click the No button

Access Project 2: Querying a Database Using the Select Query Window 66 Creating a Crosstab Query With the Tables object selected and the Client table selected, click the New Object button arrow Click Query, click Crosstab Query Wizard in the New Query dialog box, and then click the OK button With the Tables option button selected and the Client table selected, click the Next button Click the City field, and then click the Add Field button Click the Next button, and then click the Trainer Number field

Access Project 2: Querying a Database Using the Select Query Window 67 Creating a Crosstab Query Click the Next button, click the Amount Paid field, and then click Sum Click the Next button, and then type City- Trainer Crosstab as the name of the query Click the Finish button If instructed to print the results, click the Print button Close the query by clicking its Close Window button

Access Project 2: Querying a Database Using the Select Query Window 68 Creating a Crosstab Query

Access Project 2: Querying a Database Using the Select Query Window 69 Closing a Database and Quitting Access Click the Close Window button for the Ashton James College : Database window Click the Close button for the Microsoft Access window

Access Project 2: Querying a Database Using the Select Query Window 70 Summary Create and run queries Print query results Include fields in the design grid Use text and numeric data in criteria

Access Project 2: Querying a Database Using the Select Query Window 71 Summary Create and use parameter queries Save a query and use the saved query Use compound criteria in queries Sort data in queries

Access Project 2: Querying a Database Using the Select Query Window 72 Summary Join tables in queries Perform calculations in queries Use grouping in queries Create crosstab queries

Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 2 Complete