Microsoft Office Tutorials and References
In Depth Information
9. Resize all datasheet columns to their best fit. Scroll through the entire datasheet to make
sure that all values are completely displayed. Deselect all columns when you are finished
resizing them, and then return to the top of the datasheet. See Figure 3-31.
Results of query using the Or logical operator
records with HoursPerWeek values of less than 30
10. Save the query with the name HoursOrExperience , and then close the query.
Next, Elsa wants to use the Northeast database to perform calculations. She is consider-
ing offering a 2% bonus per week to the student recruits in higher paid positions, based on
employer recommendation, and she wants to know exactly what these bonuses would be.
In addition to using queries to retrieve, sort, and filter data in a database, you can use a
query to perform calculations. To perform a calculation, you define an expression con-
taining a combination of database fields, constants, and operators. For numeric expres-
sions, the data types of the database fields must be number, currency, or date/time; the
constants are numbers such as .02 (for the 2% bonus); and the operators can be arith-
metic operators (+ – * /) or other specialized operators. In complex expressions, you can
enclose calculations in parentheses to indicate which one should be performed first. In
expressions without parentheses, Access calculates in the following order of precedence:
multiplication and division before addition and subtraction. When operators have equal
precedence, Access calculates them in order from left to right.
To perform a calculation in a query, you add a calculated field to the query. A calculated
field is a field that displays the results of an expression. A calculated field appears in a query
datasheet or in a form or report; however, it does not exist in a database. When you run a