IT tutorials
 
Office
 

Microsoft Accesss 2010 : Enhancing the Queries That You Build - Creating and Running Action Queries (part 3) - Creating and Running Append Queries

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
11/16/2014 8:04:33 PM

Creating and Running Append Queries

You can use Append queries to add records to existing tables. You often perform this function during an archive process. First, you append to the history table the records that need to be archived by using an Append query. Next, you remove the records from the master table by using a Delete query.

Build an Append Query

To build an Append query, follow these steps:

1.
While in Design view of a query, select Append from the Query Type group on the Design tab of the Ribbon. The dialog box shown in Figure 5 appears.

Figure 5. The dialog box in which you identify the table to which data will be appended and the database containing that table.


2.
Select the table to which you want Access to append the data.

3.
Drag all the fields whose data you want included in the second table to the query grid. If the field names in the two tables match, Access automatically matches the field names in the source table to the corresponding field names in the destination table (see Figure 6). If the field names in the two tables don’t match, you need to explicitly designate which fields in the source table match which fields in the destination table.

Figure 6. An Append query that appends to another table the Order ID, Employee ID, Customer ID, Order Date, Shipped Date, and Shipper ID of each order with an order date prior to 2/1/2006.

4.
Enter any criteria in the query grid. Notice in Figure 6 that the example appends to the destination table all records with an order date before 2/1/2006.

5.
To run the query, click Run in the Results group on the Design tab of the Ribbon. The message box shown in Figure 7 appears.

Figure 7. The Append query confirmation message box.


6.
Click Yes to finish the process.

The SQL behind an Append query looks like this:

INSERT INTO tblTimeCardsArchive ( TimeCardID, EmployeeID, DateEntered )
SELECT tblTimeCards.TimeCardID, tblTimeCards.EmployeeID,
tblTimeCards.DateEntered
FROM tblTimeCards
WHERE (((tblTimeCards.DateEntered) Between #1/1/95# And #12/31/95#));

Append queries don’t allow you to introduce any primary key violations. If you’re appending any records that duplicate a primary key value, the message box shown in Figure 8 appears. If you go ahead with the append process, Access appends to the destination table only records without primary key violations.

Figure 8. The warning message you see when an Append query and conversion, primary key, lock, or validation rule violation occurs.

 
Others
 
- Microsoft Accesss 2010 : Enhancing the Queries That You Build - Creating and Running Action Queries (part 2) - Creating and Running Delete Queries
- Microsoft Accesss 2010 : Enhancing the Queries That You Build - Creating and Running Action Queries (part 1) - Creating and Running Update Queries
- Microsoft Accesss 2010 : Enhancing the Queries That You Build - Creating and Running Parameter Queries
- Microsoft Accesss 2010 : Enhancing the Queries That You Build - Getting Help from the Expression Builder
- Microsoft Accesss 2010 : Enhancing the Queries That You Build - Creating Calculated Fields
- Using OneNote with Other Office 2010 Applications : Entering Outlook Information (Email, Meeting, Contact, Task) on a Page
- Using OneNote with Other Office 2010 Applications : Entering Meeting Details from Outlook in a Note
- Using OneNote with Other Office 2010 Applications : Opening a Page in Word, Creating an Outlook Task in OneNote
- Microsoft Visio 2013 : A Visual Orientation to a Visual Product - Panning and zooming in Visio
- Microsoft Visio 2013 : A Visual Orientation to a Visual Product - Managing the Shapes window
 
25 Inspiring Game of Thrones Quotes
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS