Presentation is loading. Please wait.

Presentation is loading. Please wait.

By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 5 Data Validation and Data Analysis.

Similar presentations


Presentation on theme: "By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 5 Data Validation and Data Analysis."— Presentation transcript:

1 by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 5 Data Validation and Data Analysis 1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

2 Establish data validation Create an input mask Create and modify a lookup field Create a parameter query Use advanced functions in the Expression Builder Perform date arithmetic 2 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

3 Data validation - set of constraints or rules that help control how data is entered into a field Built-in validation – Cannot enter text in a field with a number data type – Cannot add records with duplicate values in the primary key field 3 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

4 Customizable validation methods – Required – Default Value – Validation Rule – Validation Text 4 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

5 Customizable validation methods (cont.) – Input Mask – Lookup List – Multiple-Value Field – Data Macro 5 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

6 Validation properties for the short text field type: 6 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

7 Establish required fields – A required field cannot be left blank – Primary key fields are required fields Examples of required fields – Last name – Social Security number 7 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

8 Set default field values – A default value can be set for fields that have a common value to reduce data entry time Examples of default values – City – State 8 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

9 Set a validation rule and generate validation Text – A validation rule restricts the data values that can be entered into a field Example of when to use a validation rule – To ensure data entered into a salary field is greater that zero 9 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

10 An input mask controls the format of data entered into a field Using an input mask to specify format for phone number entry: 10 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

11 Use the Input Mask Wizard – The Input Mask Wizard can be used to create an input mask by answering a few short questions Locating the Input Mask Wizard launch button: 11 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

12 A lookup field provides more input control by displaying a list of values to choose from in a menu Example of a drop-down menu in a lookup field: 12 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

13 Examples of a lookup field – Anytime there are specific or restricted choices – Classes available – State Storing values in a table makes it easier to update the list 13 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

14 Modify a lookup field by adding and deleting values – Lookup fields can be modified to fit changing needs – After a change, table data will need to be verified to reclassify records affected by the change 14 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

15 Parameter query – a type of query where the user provides criterion at run time instead of in advance Provides flexibility Reduces development time Can be used repeatedly 15 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

16 Example of criteria entry when creating a parameter query: 16 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

17 Parameter report – Report based on a parameter query – User controls content of report 17 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

18 The Expression Builder is used to create mathematical functions 125 built-in functions in Access 18 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

19 Date Function – Calculates the current date – No parameters – Used as default date value – Syntax: Date() 19 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

20 Round Function – Returns a number rounded to a specific number of decimal places – Precision determines decimal places – If precision is blank, assumes nearest whole number – Syntax: Round(expression, precision) 20 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

21 IsNull Function – Checks whether a field has no value assigned – Useful in comparisons – Syntax: IsNull(expression) 21 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

22 IIf Function creates conditional output – Evaluates an expression and displays one value when expression is true and another value when false – Three parts: question, what to do if yes, what to do if no – Syntax: IIf(expression, truepart, falsepart) 22 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

23 Nesting functions – Using one function within another function – Functions separated by parentheses and brackets – Example of a nested function: Sqr(Abs([Hypotenuse])) 23 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

24 Combine IIf with other expressions – The IIf function is often combined with other expressions – Example of an IIf function combined with an expression: IIf(Date() – [RegistrationDate] <=7, “New Registration”, “Registered”) 24 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

25 Use Nested IIf Functions – Used when two conditions are not sufficient to evaluate an expression – Example of a nested IIf function: IIf(Date() – [RegistrationDate] <=2, “Brand New Registration”, IIf(Date() – [RegistrationDate] <=7, “New Registration”, “Registered”)) 25 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

26 Date formatting affects the date’s display without changing the underlying value Date arithmetic allows users to create expressions to calculate a lapsed time – Example of date arithmetic would be calculating age based on birth date 26 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

27 DatePart Function – Examines a date and returns a portion of the date – Returns a numeric value for a selected interval – Syntax: DatePart(Interval, date, firstdayofweek, firstweekof year) 27 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

28 Parameters of the DatePart Function – interval – date – firstdayofweek – firstweekofyear 28 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

29 Examples of the DatePart Function: 29 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

30 Apply criteria and grouping to DatePart results – A calculated field using DatePart can have criteria applied to extract specific information – Example of a DatePart function with criteria: DatePart(“m”, [Employees]![HireDate]) 30 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

31 In this chapter you learned to: – Establish data validation – Create an input mask – Create and modify a lookup field – Create a parameter query – Use advanced functions in the Expression Builder – Perform date arithmetic 31 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

32 32 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall.

33 33 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.


Download ppt "By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 5 Data Validation and Data Analysis."

Similar presentations


Ads by Google