• Save
AIA101.2.Access Queries Accelerated
Upcoming SlideShare
Loading in...5

AIA101.2.Access Queries Accelerated



Queries module in course Accelerated Introduction to Microsoft Access. Only retrieval is covered in this module. See the Automating Access module for the Action Queries.

Queries module in course Accelerated Introduction to Microsoft Access. Only retrieval is covered in this module. See the Automating Access module for the Action Queries.



Total Views
Views on SlideShare
Embed Views



3 Embeds 4

http://www.linkedin.com 2
http://www.slideshare.net 1
https://www.linkedin.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

AIA101.2.Access Queries Accelerated AIA101.2.Access Queries Accelerated Presentation Transcript

  • Microsoft Access Module: Queries P.O. Box 6142 Laguna Niguel, CA 92607 949-489-1472 http://www.d2associates.com [email_address]
  • Module Hands On
      • Create a simple query
      • Create a multi-table query
      • Create calculated fields
      • Create a summary query
      • Concatenate fields
      • Create a parameter query
    • Students “hands-on”:
  • Creating a Query
    • Activate the Queries tab of the Database window
    • Click the New button
    • Select the type of query
    • Interact with the dialog boxes
  • Query Results
    • Results placed in a dynaset in a window
    • Dynaset can be used like a regular table
      • Most useful when you work with fields from several tables
      • Any changes that are made to a dynaset field are also made to the original record
  • Query Design Window
    • QBE grid - controls which fields appear in the dynaset
    • Parts of the grid
      • Field - contains the name of the field
      • Table - contains the field’s table name
      • Sort - controls the order of displayed data
      • Show - displays a field in the dynaset
      • Criteria - enter a condition to display selected records
  • Criteria
    • Logical Comparison Operators
      • <, >, =, =<, >=. <>
    • Special Operators
      • LIKE
      • IS NULL
      • BETWEEN
      • IN
    • Special characters
      • [ square brackets around names]
      • (parentheses around function arguments)
      • # pound sign around dates#
  • Like (“Wild Card Matches”)
    • ANSI standard
    • Where customer_last_name like “Jo%”
    • Like “Jo_”
    • Microsoft Access
    • Where customer_last_name like “Jo*”
    • Like “Jo?”
    • * means match any string of characters; ? means match one character.
    • Access actually allow more sophisticated Unix type search patterns as well – see help
  • Create a Simple Query
    • Use Work_Orders table
    • Show fields: all except accum
    • Sort by WoNo
    • Only records where description contains an “s”
    • Save your query as qrySimple
  • Simple Query (Find all records with an “S in the description field) Query by Example (QBE) Grid
  • Joining Tables
    • Tables can be joined for performing a query
      • Must have a common field
      • Linking in QBE grid performed via a drag operation
      • Join types: inner, left outer, right outer
      • Use show tables dialog to bring up list of tables
  • Joining two Tables Double Click table name to add Drag from PK to FK
  • Create a multi-table query
    • Join Labor and Employees
    • Show following fields: all from labor, fname, lname and rate from employees
    • Sort by empno then wono
    • Save your query as qryLaborDetail
  • Multi-table Query Design
  • Multi-table Query Results
  • Calculated Fields
    • Can embed calculations in a query
    • Creates a new temporary field which appears in the dynaset
    • Store your calculations there
    • Can use an expression “builder” to help
  • Query with Calculated Field (use the builder)
  • Query with Calculated Field
    • Use qryLaborDetail
    • Add a calculated field which shows the cost of a labor ticket
    • Save your query as qryLaborDetail_2
  • Query with Calculated Field Results
  • Concatenated Fields
    • Can “add” two character fields together
    • Use & operator
    • Example: fname & “ “ & lname
  • Concatenated Fields
    • Create a new labordetail query
    • Add a column with the employee’s full name
    • This can be used later in reports, etc.
    • Save your query as qryLaborDetail_3
  • Concatenated Fields Results
  • Summarizing Columns
    • SQL aggregate functions
      • Sum
      • Count
      • Avg
      • Etc.
    • Activated by clicking the Total toolbar button
    • Adds a Total line to the QBE query grid
    • All selected columns must be in group by or an aggregate
  • Query with Aggregate
  • Query with Aggregate
    • Modify qryLaborDetail2
    • Drop work order fields
    • Sum the hours and cost
    • Save your query as qryLaborGrouped
  • Query with Aggregate Results
  • Parameter Queries
    • Accept a variable when run
    Order No parameter
  • Parameter Queries
    • Create a parameter query
    • Base on qryLaborDetail_3
    • Show all fields
    • Prompt for order no
    • Save as qryParam
  • Parameter Query Results
  • Accelerated Introduction to Access End of Module P.O. Box 6142 Laguna Niguel, CA 92607 949-489-1472 http://www.d2associates.com