Query
Query
An append query adds a set of records (rows) from one or more source tables (or queries) to one
or more destination tables. Typically, the source and destination tables reside in the same
database, but they don't have to. For example, suppose that you acquire some new customers and
a database that contains a table of information about those customers. To avoid entering that new
data manually, you can append it to the appropriate table in your database. You can also use
append queries to:
1. Append fields that are based on criteria. For example, you might want to append only the
names and addresses of customers who have outstanding orders.
2. Append records when some of the fields in one table don't exist in the other table. For
example, suppose that your Customers table has 11 fields, and the fields in the Clients
table in another database match 9 of your 11 fields. You can use an append query to add
only the data in the matching fields and ignore the others.
Note. You cannot use append queries to change the data in individual fields in existing records.
You can only use Append queries to add rows of data.
7. Adjust Fields name [Student ID] to Student ID and again change [EMP-ID] to EMP-ID
Update Queries
Create a Select Query in Design View to determine the records that will be updated.
Modify the query by adding the appropriate data source(s) and criteria. In this example, a
company will be raising All Employee by Percent for example by 5%
1. Click Create Tab the click on Other Group
2. Click Query Design View
9. Save the Query by the Name Update Query and Close the Query
10. Finally Open The Employee Table
.
Continue to add criteria in the appropriate fields to complete your query.
Right-click on the query’s tab at the top and click Save.
From the Design ribbon, go to the Results area and click on the Run button to test your
query.
The Enter Parameter Value window will appear for each criterion that has to be
specified.
Tip: Parameter queries are helpful when used as the basis for forms, reports and data access pages.
For example, you can create a monthly earnings report based on a parameter query. When you
print out the report, Access displays a dialogue box asking for the month that you want the
report to cover. Once you enter the desired month, Access will print the appropriate report.
From the Design ribbon, go to the Query Type area and click on the Crosstab button.
Repeat these steps for each field you desire to use as a row heading in the query.
You can also choose to make a field a Column Heading or a Value in the same manner
Note: You MUST have at least one of each (Row Heading, Column Heading, and Value) to run a
Crosstab Query.
Tip: You can select Column Heading for one field only, and as with Row headings, you must leave
Delete Queries
Create a Select Query in Design View to determine the records what will be deleted.
Modify the query by adding the appropriate data source(s) and criteria. In this example, a
company wishes to cut costs at the lowest payroll levels and accordingly removes employees
making less than 1,000
Crete Query Using Design View
Add Employee Table
Insert All fields to QBE
Save Query
Click Query Tools(Design) under Query Type Delete Query
Click on the Run button. A Microsoft Office Access window will appear, warning that fields
from the table will be deleted.
The specified records will be deleted from your table. Open your table to verify that the
proper records were deleted.
Click on the Save button if you are satisfied with the action query results.
Tip: Note that delete queries always delete entire records, not just selected fields within records.