Documente Academic
Documente Profesional
Documente Cultură
Microsoft
Access 2013 Office
Lesson Objectives
• Add, move and rearrange • Use the Find and Replace
query fields feature
• Hide and show query • Use wildcards in
fields expressions
• Format query fields • Sort records
• Display query totals • Filter records by selection
• Add criteria to a query and form
• Using comparison • Create a query in Query
operators in expressions Design view
• Create a query using the
Query Wizard
Lesson Objectives
• Group and summarize • Use special operators in
data expressions
• Create update queries • Use the Expression
• Create make-table Builder
queries • Work with joined tables
• Create append queries • Add totals and calculated
• Create delete queries fields
• Create crosstab queries • Create parameter queries
• Add conditional logic to
queries
Retrieving Data
• Access provides several methods for finding exactly the
data you want.
• These methods include:
– Using the Find features
– Sorting records
– Filtering tables
– Using queries
Finding Records
• You can use the Find feature
to locate records that
contain a specific value in a
particular field
• The Find feature searches
the datasheet and moves
the record selector to the
first record that matches the
value you specify
• Click the Find command
button to open the Find and
Replace dialog box
Using Wildcards
Sorting Records
• By default, records display in ascending order by the
primary key field if one is defined
• To sort a datasheet:
– Click in any record in the column you want to use for the
sort order
– Click either the Ascending or Descending button
• To remove a sort, click the Remove Sort button in the
Ribbon
• When you sort by more than one column, the first
column selected is the secondary sort key; the last
column selected is the primary sort key
• Sorting merely rearranges the data in a datasheet
Filtering Records
• Filtering enables you to isolate specific records
• Filters use a set of conditions called criteria to test
records and determine whether or not they should be
displayed
• When a filter is applied, only a subset of the data
displays
• Filtering affects only which records are displayed in the
datasheet; it does not affect the underlying data
Filter by Selection
Filter by Form
• Filter by Form allows
you to specify
multiple criteria
• To filter by form, click
the Advanced button
and select Filter by
Form to open a blank
Filter by Form window
Creating Queries
• A query asks a question of a table
• A select query is a specialized instruction which selects
and displays specific information from a table
• The resulting set of records is called a result set or a
dynaset
• To create a query:
– Specify the table(s) from which the query will select data
– Specify which table fields will be included
– Specify how the result set will be organized for display
• A select query is stored as a database object
Modifying Queries
• To add or delete fields, drag them onto or off of the
design grid
• To rearrange columns, drag a column to a new position
in the design grid
• Use the Sort row in the design grid to sort the records in
the result set
• To hide a field in a query, clear the Show check box in
the design grid
Arithmetic Operators
Operator Interpreted As Example
^ Power [Quantity] ^ 2
Comparison Operators
= Equal to =“NY”
Concatenation Operators
• Used to join strings of text together to form one text
string
• The most commonly used concatenation operator is the
ampersand (&) symbol
• Ex: [FirstName] & “ “ & [LastName]
Logical Operators
Special Operators
Displaying Totals
• You can add a total row to a query result set just as you
can to a datasheet
Aggregate Functions
Group By Defines the groups for which you StDev Returns the standard deviation of
want to perform calculations the values in a field
Sum Returns the total of the values in a Var Returns the variance of the values
field in a field
Avg Returns the average of the values in First Returns the value from the first
a field record in a table or query
Min Returns the smallest value in a field Last Returns the value from the last
Max Returns the largest value in a field record in a table or query
Count Returns the number of values in a Expression Creates a calculated field that
field (not including null records) includes an aggregate function
Where Specifies criteria for a field you
are not using to define groupings
Lesson Summary
• Add, move and rearrange • Use the Find and Replace
query fields feature
• Hide and show query • Use wildcards in
fields expressions
• Format query fields • Sort records
• Display query totals • Filter records by selection
• Add criteria to a query and form
• Using comparison • Create a query in Query
operators in expressions Design view
• Create a query using the
Query Wizard
Lesson Summary
• Group and summarize • Use special operators in
data expressions
• Create update queries • Use the Expression
• Create make-table Builder
queries • Work with joined tables
• Create append queries • Add totals and calculated
• Create delete queries fields
• Create crosstab queries • Create parameter queries
• Add conditional logic to
queries
Review Questions
1. Which statement accurately compares filtering to sorting?
Review Questions
2. Amanda wants to add another table to her query. Which of the
following buttons should she click on the Ribbon?
a. Make Table
b. View
c. Show Table
d. Update
3. Phil is having difficulty achieving the sort order he wants for a query.
He wants to sort in ascending order by state, and then in descending
order by city. Which of the following is most likely the problem?
a. The query is read-only and cannot be modified.
b. The primary key for the table is a number field, making it
impossible to sort on a text field.
c. The Format property for the State field is set to Non-indexed.
d. The City field is further left than the State field in the design grid.
Review Questions
4. What function does the Zoom box serve?
a. You can use it to build accurate expressions.
b. You can use it to display expressions and make them easier to
read.
c. You can use it to optimize a query and make it run faster.
d. You can use it to quickly add the fields in a field list to the design
grid.