|Figure 1: tblEmployees. As you can see, there are 6 Telesales Employees.|
Notice how their salaries change after the Update Query is run.
- Click the QUERY DESIGN icon (located on the QUERIES group of the CREATE ribbon).
- Select the tlbEmployees table from the SHOW TABLES dialog form.
- Double click the JobTitle and Salary fields from the employees table, so they appear as columns on the Query Design Grid.
- Enter ="Telesales" in the criteria row of the JobTitle column.
- Click the RUN icon to run the query.
|Figure 2: Results of the Select Query|
in stage one.
- Re-open the Select Query in Design View. If the Select Query is already open in DATASHEET VIEW, simply click the DESIGN VIEW icon from the VIEWS group of the HOME ribbon. Otherwise you can highlight the Query name in the NAVIGATION PANE, right click the mouse, and then click the DESIGN VIEW icon from the drop down menu.
- Once the Query opens in DESIGN VIEW, click the UPDATE QUERY icon from the QUERY TYPE group of the DESIGN ribbon. The Icon is then highlighted in orange.You will also notice that the SHOW and SORT rows of the QUERY DESIGN GRID have disappeared, being replaced by a new row called UPDATE.
- All we need to do now is enter the calculation into the UPDATE row of the Salary column. The calculation to enter is: [salary]*1.05
Figure 3: This is what the Query Design Grid should
now look like for the Update Query.
- Click the RUN icon from the RESULTS group of the DESIGN ribbon.
- Click YES when you receive a warning message saying "you are about to update 6 row(s)".