Activity 11.7 DATAMANIPULATION
Create calculated fields Perform calculations at run time Format fields One way of performing a calculation on data in a database is to create a calculated field which is worked out in a calculation performed on other fields in the database. This is called a calculation produced at run time. PRODUCING CALCULATIONS
Load MS Access Calculated fields Pay rise New salary NEW CALCULATED FIELDS Choose a simple Query
NEW CALCULATED FIELDS Add the given fields: Forename Surname Position Salary Give the query a name And Select Modify
QUERY DESIGN In the first row of the first empty column enter the formula: Pay rise:[Salary]*5/100 New field name is written to the left of the colon Fieldname used in the formula must be exactly the same as those used in the database Field names used in formula muste be enclosed in square brackets
QUERY DESIGN Adjust the column In the next blank column enter the formula: New salary:[Salary]+[Pay rise]
RESULT OF THE QUERY The pay rise column needs to be modified! Go back to design view
CORRECTING Right-click and choose properties Watch out
VIEW AND SAVE