Actions Queries. Understanding Action Queries  Action queries are a way to make corrections to database. They can make an enormous mess of database if.

Slides:



Advertisements
Similar presentations
Objectives Create an action query to create a table
Advertisements

MS-Access XP Lesson 2. Input Mask Property 1.Field : Phone No Data Type : Number Input Mask : Character 0 represent a single digit and phone.
Chapter 5 Creating, Sorting, and Querying a Table
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Queries Help Topics Using the Access 2007, you can press the F1 to pop up the help windows, where you can search the following topics to help to generate.
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
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.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Access Tutorial 10 Automating Tasks with Macros
Chapter 2 Querying a Database
Tutorial 8 Managing and Securing a Database. Objectives Filter data in a table and a form Save a filter as a query and apply the saved query as a filter.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 1Advanced Tables, Relationships, Queries, and Forms Chapter 3Advanced Query Techniques.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Working with a Database
Tutorial 8 Advanced Queries. Notes Switch to new database! Tutorial.08 folder Only Session 8.1 and 8.2.
Access Tutorial 2 Building a Database and Defining Table Relationships
Chapter 1 Databases and Database Objects: An Introduction
Chapter 6 Advanced Report Techniques
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
More about Databases. Data Entry through Forms Table View (Data sheet view) is useful for data entry of new records But sometimes customization would.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
CS1100: Data, Databases, Queries Action Queries CS11001Advanced Queries.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Filtering Data A filter is a set of restrictions you place on the records of an open datasheet or form to temporarily isolate a subset of the records.
Microsoft Access 2010 Chapter 10 Administering a Database System.
® Microsoft Office 2013 Access Creating a Database.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
COMPREHENSIVE Access Tutorial 12 Managing and Securing a Database.
® Microsoft Access 2010 Tutorial 12 Managing and Securing a Database.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
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.
O FFICE M ANAGEMENT T OOL - II B BA -V I TH. Abdus Salam2 Week-7 Introduction to Query Introduction to Query Querying from Multiple Tables Querying from.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Ennis-Cole, AC 2.01, CECS Maintaining A Database By: Dr. Ennis-Cole.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
CS1100: Data, Databases, Queries Action Queries CS11001Advanced Queries.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
® Microsoft Access 2010 Tutorial 8 Managing and Securing a Database.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Access Tutorial 2 Building a Database and Defining Table Relationships
Using Macros, Switchboards, PivotTables, and PivotCharts
Tutorial 8 Managing and Securing a Database
Objectives Create an action query to create a table
Access Creating a Database
Banner 9 Navigation Keys
Access Creating a Database
Chapter 1 Databases and Database Objects: An Introduction
Access: Queries IV Participation Project
Access Tutorial 2 Building a Database and Defining Table Relationships
Access Tutorial 2 Building a Database and Defining Table Relationships
Topic 15 Lesson 1 – Action queries
Creating a simple query in the Design View
Tutorial 9 Using Action Queries and Advanced Table Relationships
Presentation transcript:

Actions Queries

Understanding Action Queries  Action queries are a way to make corrections to database. They can make an enormous mess of database if used incorrectly.  Action queries differ from select queries: − A select query shows you data that meet your criteria. − An action query looks for the data that meets your criteria, and then does something with it, such as making changes to the data or moving records to a new table.

Testing Action Queries (Carefully)  Most importantly, before you use an action query, make a database backup! because it may not always generate the result you expect (mong đợi).  To make a backup, you can copy your.accdb database file or File ➝ Save & Publish to enter Backstage view, look in the Advanced section of the Save Database As list  Back Up Database.

The Action Query Family  An update query changes the values in one or more records.  An append query selects one or more records, and then adds them to an existing table.  A make-table query selects one or more records, and then creates a new table for them.  A delete query deletes one or more records.

Update Queries  An update query searches for some records and then modifies them.  Using the update query when you work on lots of data or when you want to update multiple fields.  Update query makes to change multiple records at same time.

Update Queries  To Create a Update Query: − Select Create tab  Queries  Query Design. − Add each table you want to include in query by selecting it and then clicking Add. − Change query to an update query by choosing Query Tools  Design  Query Type  Update. − Add the fieldyou want to use for filtering, and then set the Criteria box for each one.

Update Queries − Add the field you want to change. − In the Update To box, supply the new value that your query will apply to each field.

Update Queries − Add any other fields that you want to inspect to confirm that you’re selecting the correct records. − Right-click the query’s tab title, and choose Datasheet View to see the rows that query affects. − Now switch back to Design view, choose Query Tools  Design  Results  Run to run update query and have Access apply your changes.

Update Queries  Access warns you about the change it’s about to make. Click Yes to make the change.  If you want to save your query, then press Ctrl+S You’ll need to supply a name for your query.

Append Queries  An append query selects records from a table and then inserts them into the end another table.  You may want to use an append query to transfer records from one database to another. This technique is handy if you have duplicate tables in different databases.  To transfer the records, you need to make sure the two tables line up. (Page 255)

Append Queries  Create a new query by choosing Create  Queries  QueryDesign.  Using the Show Table dialog box, add the source table that has the records you want to copy.  Query Tools Design ➝ Query Type ➝ Append.

Append Queries − Another Database: transfer the records to another database  clickBrowse to select database file  OK. − Table Name box: enter the name of the table to which you want to transfer the records. − Click OK to close the Append or Make Table dialog box. − Add the field you want to copy from the source table.

Append Queries − If you’re creating an append query, then fill in the names of the destination fields in the Append To boxes. − If want to copy only some of the records in the source table, then set the filter conditions you need. − Choose Datasheet View to see the rows that your query affects.

Append Queries − Switch back to Design view, and then choose Query Tools Design  Results  Run to transfer your records. − Press Ctrl+S to save query.

Make-Table Query  The make-table query creates the destination table, and then copies the records to it. − Open the source database. − Choosing Create ➝ Queries ➝ Query Design. − Add the source table that has the records you want to copy. − Select Query Tools ➝ Design ➝ Query Type ➝ Make Table.

Make-Table Query − Another database: transfer the records to another Database, click Browse to select database file  OK. − Table Name: enter the name of the table which you want to transfer the records.

Make-Table Query − Add the field you want to copy from the source table. − To copy only some of the records in the source table, then set the filter conditions. − Choose Datasheet View to see the rows that your query affects. − Switch back to Design view  Results ➝ Run to transfer the records. − Press Ctrl + S to save query.

Delete Queries  Delete queries are the simplest and most dangerous of the action queries.  Delete query erases records from the database.  To create a delete query: − Select Create tab ➝ Queries ➝ Query Design. − Add the table that has the records you want to delete. − Select Query Tools Design ➝ Query Type ➝ Delete.

Delete Queries − Add the fields you want to use for filtering, and then set filter conditions. − Add the fields that you want to inspect to confirm you’re getting the correct records in the datasheet view. − Choose Datasheet View to see the rows that’ll be affected by query. − Switch back to Design view, choose Query Tools  Design  Results  Run to remove the records.