Download presentation
Presentation is loading. Please wait.
Published byGeorgina Bennett Modified over 9 years ago
1
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Access 2010 © 2011 The McGraw-Hill Companies, Inc. All rights reserved.
2
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Create and modify select queries 1 Add criteria and operators to queries 2 Apply logical operators 3 Modify query properties 4 Add calculations to queries 5 Create queries with wizards 6 2
3
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 3
4
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-1 Figure 6-1 4
5
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-1 Figure 6-2 & 3 5
6
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-2 Figure 6-4 6
7
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-3 7 You can add fields to the design grid of a query by any of the three following ways: Double-click the field name in the Field List. Drag the field from the Field List to a Field row in the design grid. Click the Field row in the design grid and select a field name from the drop-down list.
8
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-3 Figure 6-5 8
9
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-4 Figure 6-6 9
10
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 10
11
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-5 11 An operator is a word or symbol that indicates a specific arithmetic or logical relationship between the elements of an expression. Operators are used to create conditions. Operators can include arithmetic operators, such as the plus sign (+); comparison operators, such as the equals sign (=); logical operators, such as the word “And”; concatenation operators, such as & and +; and special operators, such as “Like,” “Between,” or “In.”
12
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-5 12 In addition to operators, a condition can include one or more functions. A function is a procedure used in an expression. Most functions include multiple arguments. An argument is a reference in a function assigned as a single variable. Some functions such as “Date” do not require arguments. Other functions such as “DateDiff” contain both required arguments and optional arguments.
13
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. TypeDefinitionExamples Arithmetic operator A word or symbol that calculates a value from two or more numbers. +, −, *, /, \, ^ Comparison operator A symbol or combination of symbols that specifies a comparison between two values. A comparison operator is also referred to as a relational operator. =, <>,, >= Logical operator A symbol, word, group of symbols, or group of words used to construct an expression with multiple conditions. And, Or, Eqv, Not, Xor Concatenation operator A symbol, word, group of symbols, or group of words used to combine two text values into a single text value. &, + Special operators Like, Between, In, True, False 13 Table 2-1 Exercise 2-8
14
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-5 Figure 6-7 14
15
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-5 15 Queries often use comparison operators to evaluate data. Comparison operators allow you to evaluate numbers, text, and dates. For example, the expression “>10/17/11” would display all records with a date after October 17, 2011. The expression “>=10/17/11” would display all records with a date on or after October 17, 2011. When comparing text, fields are evaluated alphabetically. The expression <“smith” would display all records that appear in a dictionary before the word “smith”.
16
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. OperatorMeaning = Equal <> Not equal < Less than <= Less than or equal to > Greater than >= Greater than or equal to 16 Table 6-2 Exercise 6-6
17
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-6 Figure 6-9 17
18
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-7 Figure 6-10 18
19
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Exercise 6-7 Figure 6-10 19
20
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 20 Figure 6-12 Exercise 6-8
21
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 21
22
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 22 Figure 6-13 Exercise 6-9 When an AND condition is placed on a single field, the keyword AND must be placed between the two conditions. When an AND condition is placed on multiple fields, the keyword is not entered. When more than one field contains a condition on the same Criteria row, then an AND condition is created automatically by Access.
23
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 23 Figure 6-13 to 15 Exercise 6-8
24
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 24
25
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 25 Figure 6-18 Exercise 6-11
26
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 26 Exercise 6-12 Just as a table can display a related table as a subdatasheet, a query can also contain a subdatasheet. A subdatasheet is created by defining a Subdatasheet Name as a query property. The sheets must be linked by a common field. You will now modify qryMgtContacts by linking the ManageID field between the tables management and facilities.
27
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 27
28
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 28 Exercise 6-13 An aggregate function is a sum, average, maximum, minimum, or count for a group of records. A calculated field is a field that uses an expression or formula as its data source.
29
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. ComponentDescription Expression box White area at the top of the window that shows the formula as you build it. (Also called the preview area.) Expression Elements List of elements available to build an expression. Expression Categories Subset of the elements found in the Expression Elements panel. Expression Values Subset of the categories found in the Expression Categories panel. 29 Table 6-4 Exercise 6-13
30
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 30 Figure 6-19 Exercise 6-13
31
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 31 Figure 6-20 Exercise 6-13
32
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 32 Figure 6-22 & 23 Exercise 6-15
33
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 33
34
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 34 Figure 6-24 Exercise 6-16
35
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 35 Figure 6-25 Exercise 6-16
36
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 36 Figure 6-27 Exercise 6-18
37
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 37 Figure 6-27 Exercise 6-18
38
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 38 Figure 6-28 Exercise 6-19
39
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 39
40
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 40 Figure 6-28 Exercise 6-19
41
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 41 Figure 6-30 Exercise 6-21
42
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 42 Figure 6-31 Exercise 6-21
43
a lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Access 2010 © 2011 The McGraw-Hill Companies, Inc. All rights reserved. 43
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.