Microsoft Access Tutorial B - Cengage Learning

Microsoft Access Tutorial B - Cengage Learning Microsoft Access Tutorial B - Cengage Learning

muricmilorad.files.wordpress.com
from muricmilorad.files.wordpress.com More from this publisher
12.07.2015 Views

Figure B-17 Query set-up for wages owed to hourly employees for Week 2In the previous table, the calculated field column was widened so you can see thewhole expression. To widen a column, remember to click the column boundary lineand drag to the right.Run the query. The output should be similar to that shown in Figure B-18 (if you formattedyour calculated field to currency).Figure B-18 Query output for wages owed to hourly employees for Week 2Notice that it was not necessary to pull down the Wage Rate and Hours fields to makethis query work. Return to the Design View. There is no need to save. Select File—Close.Summarizing Data from Multiple Records (Sigma Queries)You may want data that summarizes values from a field for several records (or possibly allrecords) in a table. For example, you might want to know the average hours worked for allemployees in a week, or perhaps the total (sum of) all the hours worked. Furthermore, youmight want data grouped (“stratified”) in some way. For example, you might want to knowthe average hours worked, grouped by all U.S. citizens versus all non-U.S. citizens. Accesscalls this kind of query a “summary” query, or a Sigma query. Unfortunately, this terminologyis not intuitive, but the statistical operations that are allowed will be familiar. These operationsinclude the following:SumCountAverageThe total of some field’s valuesA count of the number of instances in a field, that is, the number of records.Here, to get the number of employees, you’d count the number of SSNnumbers.The average of some field’s values22 Tutorial B

MinVarStDevThe minimum of some field’s valuesThe variance of some field’s valuesThe standard deviation of some field’s valuesAT THE KEYBOARDSuppose that you want to know how many employees are represented in a database. The firststep is to bring the EMPLOYEE table into the QBE screen. Do that now. The query willCount the number of SSNs, which is a Sigma query operation. Thus, you must bring downthe SSN field.To tell Access you want a Sigma query, click the little “Sigma” icon in the menu, asshown in Figure B-19.Tutorial BFigure B-19Sigma iconThis opens up a new row in the lower part of the QBE screen, called the Total row. Atthis point, the screen would resemble that shown in Figure B-20.Figure B-20Sigma query set-upNote that the Total cell contains the words “Group By.” Until you specify a statisticaloperation, Access just assumes that a field will be used for grouping (stratifying) data.To count the number of SSNs, click next to Group By, revealing a little arrow. Click thearrow to reveal a drop-down menu, as shown in Figure B-21.Microsoft Access Tutorial 23

Figure B-17 Query set-up for wages owed to hourly employees for Week 2In the previous table, the calculated field column was widened so you can see thewhole expression. To widen a column, remember to click the column boundary lineand drag to the right.Run the query. The output should be similar to that shown in Figure B-18 (if you formattedyour calculated field to currency).Figure B-18 Query output for wages owed to hourly employees for Week 2Notice that it was not necessary to pull down the Wage Rate and Hours fields to makethis query work. Return to the Design View. There is no need to save. Select File—Close.Summarizing Data from Multiple Records (Sigma Queries)You may want data that summarizes values from a field for several records (or possibly allrecords) in a table. For example, you might want to know the average hours worked for allemployees in a week, or perhaps the total (sum of) all the hours worked. Furthermore, youmight want data grouped (“stratified”) in some way. For example, you might want to knowthe average hours worked, grouped by all U.S. citizens versus all non-U.S. citizens. <strong>Access</strong>calls this kind of query a “summary” query, or a Sigma query. Unfortunately, this terminologyis not intuitive, but the statistical operations that are allowed will be familiar. These operationsinclude the following:SumCountAverageThe total of some field’s valuesA count of the number of instances in a field, that is, the number of records.Here, to get the number of employees, you’d count the number of SSNnumbers.The average of some field’s values22 <strong>Tutorial</strong> B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!