Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building and Using Queries. Objectives Use the Query WizardUse the Query Wizard Work with data in a queryWork with data in a query Use Query Design ViewUse.

Similar presentations


Presentation on theme: "Building and Using Queries. Objectives Use the Query WizardUse the Query Wizard Work with data in a queryWork with data in a query Use Query Design ViewUse."— Presentation transcript:

1 Building and Using Queries

2 Objectives Use the Query WizardUse the Query Wizard Work with data in a queryWork with data in a query Use Query Design ViewUse Query Design View Sort and find dataSort and find data(continued) Microsoft Office 2013-Illustrated2

3 Objectives (continued) Filter dataFilter data Apply AND criteriaApply AND criteria Apply OR criteriaApply OR criteria Format a datasheetFormat a datasheet Microsoft Office 2013-Illustrated3

4 Use the Query Wizard A query allows you to select a subset of fields and records from one or more tables and then present the selected data as a single datasheetA query allows you to select a subset of fields and records from one or more tables and then present the selected data as a single datasheet Because a query doesn’t physically store the data, a query datasheet is sometimes called a logical view of the dataBecause a query doesn’t physically store the data, a query datasheet is sometimes called a logical view of the data Microsoft Office 2013-Illustrated4

5 Use the Query Wizard Technically, a query is a set of SQL (Structured Query Language) instructions, but because you can use Access query tools such as Query Design View, you are not required to know SQL to build or use Access queriesTechnically, a query is a set of SQL (Structured Query Language) instructions, but because you can use Access query tools such as Query Design View, you are not required to know SQL to build or use Access queries Microsoft Office 2013-Illustrated5

6 Use the Query Wizard Microsoft Office 2013-Illustrated6

7 Work with Data in a Query You enter and edit data in a query datasheet the same way you do in a table datasheetYou enter and edit data in a query datasheet the same way you do in a table datasheet Any edits you make in a query datasheet are permanently stored in the underlying tables, and are automatically updated in all views of the data in other queries, forms, and reportsAny edits you make in a query datasheet are permanently stored in the underlying tables, and are automatically updated in all views of the data in other queries, forms, and reports Microsoft Office 2013-Illustrated7

8 Working with Data in a Query Microsoft Office 2013-Illustrated8

9 Use Query Design View Use Query Design View to:Use Query Design View to: Add, delete, or move the fields in an existing query, to specify sort orders, or to add criteria to limit the number of records shown in the resulting datasheetAdd, delete, or move the fields in an existing query, to specify sort orders, or to add criteria to limit the number of records shown in the resulting datasheet Create a new query from scratchCreate a new query from scratch Microsoft Office 2013-Illustrated9

10 Use Query Design View Query Design View presents the fields you can use for that query in small windows called field listsQuery Design View presents the fields you can use for that query in small windows called field lists If you use the fields of two or more related tables in the query, the relationship between two tables is displayed with a join or link line identifying which fields are used to establish the relationshipIf you use the fields of two or more related tables in the query, the relationship between two tables is displayed with a join or link line identifying which fields are used to establish the relationship Microsoft Office 2013-Illustrated10

11 Use Query Design View Microsoft Office 2013-Illustrated11

12 Sort and Find Data The Access sort and find features are handy tools that help you quickly organize and find data in a table or query datasheet.The Access sort and find features are handy tools that help you quickly organize and find data in a table or query datasheet. Data can be sorted by clicking the list arrow on a datasheet’s column heading, then click a sorting optionData can be sorted by clicking the list arrow on a datasheet’s column heading, then click a sorting option Microsoft Office 2013-Illustrated12

13 Sort and Find Data Microsoft Office 2013-Illustrated13

14 Sort and Find buttons Microsoft Office 2013-Illustrated14

15 Filter Data Filters provide a temporary way to display a subset of records that match given criteriaFilters provide a temporary way to display a subset of records that match given criteria Filters are not used to calculate sums, averages, counts, etc.Filters are not used to calculate sums, averages, counts, etc. Filters are removed when the datasheet is closedFilters are removed when the datasheet is closed Filters can, however, be saved as queriesFilters can, however, be saved as queries Microsoft Office 2013-Illustrated15

16 Filtering Data Filter By Selection: Filtering by a given field value. Filters records for an exact match.Filter By Selection: Filtering by a given field value. Filters records for an exact match. Filter By Form: Filters by comparative dataFilter By Form: Filters by comparative data Microsoft Office 2013-Illustrated16

17 Wildcards Used to search for a pattern; represents any characterUsed to search for a pattern; represents any character Entered as criteriaEntered as criteria ? Used to search for a single character? Used to search for a single character * Used to search for any number of characters* Used to search for any number of characters Microsoft Office 2013-Illustrated17

18 Filters vs. Queries Microsoft Office 2013-Illustrated18

19 Apply AND Criteria AND criteria means all criteria must be true for the record to be selectedAND criteria means all criteria must be true for the record to be selected Created by entering 2 or more criteria in the same Criteria row of the query design gridCreated by entering 2 or more criteria in the same Criteria row of the query design grid Microsoft Office 2013-Illustrated19

20 Criteria Syntax Quotation marks (“) around text criteria and pound signs (#) around date criteria are automatically added by AccessQuotation marks (“) around text criteria and pound signs (#) around date criteria are automatically added by Access Criteria in Number, Currency, and Yes/No fields are not surrounded by any charactersCriteria in Number, Currency, and Yes/No fields are not surrounded by any characters Microsoft Office 2013-Illustrated20

21 Searching for Blank Fields 2 common criteria are Is Null and Is Not Null2 common criteria are Is Null and Is Not Null Is Null – Finds all records where no entry has been madeIs Null – Finds all records where no entry has been made Is Not Null – Finds all records where any entry has been made (even if zero)Is Not Null – Finds all records where any entry has been made (even if zero) Microsoft Office 2013-Illustrated21

22 Comparison Operators Microsoft Office 2013-Illustrated22

23 Apply OR Criteria OR criteria means any one criterion must be true for the record to be selectedOR criteria means any one criterion must be true for the record to be selected Created by entering 2 or more criteria on different Criteria rows of the query design gridCreated by entering 2 or more criteria on different Criteria rows of the query design grid Also created by entering 2 or more criteria in the same Criteria cell separated by ORAlso created by entering 2 or more criteria in the same Criteria cell separated by OR Microsoft Office 2013-Illustrated23

24 Apply OR Criteria Microsoft Office 2013-Illustrated24

25 Format a Datasheet Can: Change font size, font face, colors, gridlinesCan: Change font size, font face, colors, gridlines Microsoft Office 2013-Illustrated25

26 Formatting a Datasheet Microsoft Office 2013-Illustrated26

27 Summary Using the Query WizardUsing the Query Wizard Working with data in a queryWorking with data in a query Using Query Design ViewUsing Query Design View Sorting and finding dataSorting and finding data Filtering dataFiltering data Applying AND criteriaApplying AND criteria Applying OR criteriaApplying OR criteria Formatting a datasheetFormatting a datasheet Microsoft Office 2013-Illustrated27


Download ppt "Building and Using Queries. Objectives Use the Query WizardUse the Query Wizard Work with data in a queryWork with data in a query Use Query Design ViewUse."

Similar presentations


Ads by Google