IT tutorials
 
Office
 

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

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
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
 
 
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
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us