what are queries? queries are a way of searching for and compiling data from one or more tables....

13
Query for access

Upload: baldwin-thornton

Post on 04-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

Query for access

Page 2: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

What are queries?Queries are a way of searching for

and compiling data from one or more tables. Running a query is like asking a detailed question of your database. When you build a query in Access, you are defining specific search conditions to find exactly the data you want.

Page 3: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

Benefits of using a queryA query lets you:View data only from the fields you are interested in viewing. When

you open a table, you see all the fields. A query is a handy way to save a selection of fields.

NOTE   A query only points to data, it does not store data. When you save a query, you are not saving a copy of the data.

Combine data from several data sources. A table usually only displays data that it stores. A query lets you pick and choose fields from various sources, and specify how the information should be combined.

Use expressions as fields. For example, you could use the Date function as a field, or you could use the Format function with a field to control the way the data from the field is formatted in the query results.

View records that meet criteria that you specify. When you open a table, you see all the records. A query is a handy way to save a selection of records.

Page 4: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

Queries haveQuery WizardQuery Design

Page 5: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

Query WizardYou can use the Query Wizard to

automatically create a select query. When you use the wizard, you have less control over the details of the query design, but the query is usually created faster than if you did not use the wizard. Moreover, the wizard can catch some simple design mistakes and prompt you to perform a different action.Some design elements are not available when you use the wizard. However, when you finish using the wizard, you can modify the query in Design view.

Page 6: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

Summary Options dialog boxSum  The query returns the sum of all the values

of the field.Avg  The query returns the average of the values

of the field.Min    The query returns the smallest value of the

field.Max    The query returns the largest value of the

field.

Page 7: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

test practice

1.What summary Score is Sum Avg Max Min?Send by take a photo for me 2 picture

Page 8: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

Query Design1.Select the Create tab on the Ribbon, and locate the Queries group2.Select the Query Designcommand.

Page 9: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

3.Access will switch to Query Design view. In the Show Table dialog box that appears, select the table you would like to run a query on. Click Add, then click Close. We are running a query about our customers, so we will add the Customers table.

Page 10: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

4.The selected table will appear as a small window in the Object Relationship Pane. In the table window, double-click thefield names you would like to include in your query. They will be added to the Design Gridin the bottom part of the screen. 

Page 11: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

5.Set the search criteriaby clicking on the cell in the Criteria: row of eachfield you would like to filter. Typing criteria into more than one field in the Criteria: row will set your query to include only results that meet all the criteria. If you want to set multiple criteria but don't need the records shown in your results to meet them all, type the first criteria in the Criteria: row and additional criteria in the Or: row and the rows beneath it

Page 12: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

criteria

< Less than> greater than<= less than or equal to> = greater than or equal toNot in(“ , ”) not equal toIn(“ , ”) equal toLike(“ *”) value beginning

Signal Mean

Page 13: What are queries? Queries are a way of searching for and compiling data from one or more tables. Running a query is like asking a detailed question of

6.After you have set your criteria, run the query by clicking the Run command on the Query Tools Design tab.