Page 142 - AIS access_chang_ingraham
P. 142

140      CHAPTER 6 HUMAN RESOURCE BUSINESS PROCESS



                            9. Now we will create a query for the salaried employees. Click on Create query in
                      Design view. Click on Employee Table. This is the only table we will need for salaried
                      employees. Click on Add and Close.
                            10. Remember that we must eventually join this query with the query we just cre-
                      ated for the hourly employees and, therefore, we must match the columns we created for
                      this query. Open the Gross Pay Hourly Query and count the number of columns in that
                      query. We see that, in addition to EmployeeNo, we had six fields that related to hourly
                      employees. We then entered a field as a place holder for salaried employees. Finally, we
                      calculated gross pay. Close the Gross Pay Hourly Query.
                            11. We know that we will want EmployeeNo in the first field for the
                      salaried employees query. Drag that field from the Employee Table first field in the
                      design grid.
                            12. In the next six Field properties, type a O. These columns will now act as place
                      holders, just as the Salary column did in the Gross Pay Hourly Query.
                            13. Drag the SPayRate field from the Employee Table into the eighth column of the
                      design grid. Click on the Criteria property and type >0. This will result in listing only
                      those employees whose SPayRate is greater than zero or, in other words, only salaried
                      employees.
                            14. Click on the Field property in the ninth column of the design grid and click on
                      the Build ::~ icon in the menu bar. Type GrossPay: [SPayRate]*l in the upper portion of
                      the Expression Builder window. Click OK.



















                      FIGURE 6-24




                            15. Click on the Run    icon. Close and save the query as Gross Pay Salaried Query.
                            16. We now have to join the two queries together. We will do this by creating a union
                      query. A union query is a type of select query that combines fields from two or more tables
                      or queries into one field in the query's results with any duplicate records removed. Double-
                      click on Create query in Design view. Close the Show Table window.
                            17. Click on Query in the Menu bar. Click on SQL Specific> Union.
                            18. In the design screen for the union query, type the following SQL statement:
                                Select * from [Gross Pay Hourly Query]

                                UNION Select * from [Gross Pay Salaried Query];
   137   138   139   140   141   142   143   144   145   146   147