1 access for non-experts link tables find fields criteria join tables find missing comment lines...

30
1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

Upload: anthony-douglas

Post on 12-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

1

Access for non-experts

• Link tables• Find fields• Criteria• Join tables• Find missing comment lines• Understand relational databases (Wow!)

Page 2: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

2

Link tables

• Create new mdb• New, Link Table• Files of Type = ODBC• Machine Data Source• Gblware32

• Access 2007 – External Data, More, ODBC...

Page 3: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

3

Link tables

• Login as GLOBAL, WARE• Check Save Password (maybe)• Select the tables

Page 4: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

4

Link Tables

Page 5: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

5

Which tables?

• Invoice• Segments or TrueOD• Comments• AccountId

• What if you don't know where the data is?• Print DB Structure, print to file, RTF format• Open in Word and search

Page 6: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

6

Page 7: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

7

Unique Record Identifer

• Very important to pick the right one or ones• Some tables have multiple fields • Print DB structure tells you

• What if you don't know where the data is?• Print DB Structure, print to file, RTF format• Open in Word and search

Page 8: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

8

Query the tables

• New query• Add table or tables• Select fields

• Criteria • Always use criteria except on small tables• Date range; status <> V• Use indexed fields• Invoice Query shows most

Page 9: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

9

Create a query

• New, Design View• Add table• Select fields• Specify criteria

Page 10: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

10

Create a query

• New, Design View• Add table• Select fields• Specify criteria

Page 11: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

11

Create a query

• Prompt text in square brackets• Query, Parameters

• not required but good for dates• Validates entry

Page 12: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

12

Joining tables

• Need data from another table• Add table• Join the table

• Access will join automatically if it can• May need to delete and rejoin

• Select fields

Page 13: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

13

Joining tables

Both Provider name and Account Id name in the quey

• Add AccountID table twice• Join one from Invoice provider, one from Invoice Account Id• Select Name from each, rename at least one of them

Page 14: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

14

• New, Design View• Add table• Select fields• Specify criteria

Page 15: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

15

Inner vs Outer join

• Inner join – data always in both tables• Outer join – data may not be in one of the tables

• Account Id• The invoice account Id always has a matching record in Account ID table• The invoice booking agent may or may not have a matching record

• Inner joins are faster so use them if you are sure

Page 16: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

16

Inner vs Outer join

• Inner join (#1)

• Outer join (#2 if "big" table is 1st)

Page 17: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

17

Inner vs Outer join

Page 18: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

18

Find missing data

• Outer join – data may not be in one of the tables• Agent name was blank• These agents do not have employee Account Ids

• Sort by this field• Or, specify this field is not present ( "is null" )

Page 19: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

19

Find missing comment line

• Trickier – but very useful• Issue – entire record is missing

Page 20: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

20

Find missing comment line

1. Create a query for line 4

Page 21: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

21

Find missing comment line

2. Add that query to your main query

Page 22: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

22

Find missing comment line

3. Outer join that query to your main query

4. Add Data field to query and sort or specify IS NULL

Page 23: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

23

Find missing comment line

Page 24: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

24

Relational Database

• One to one• The account Id in Invoice has one matching (associated) record in Account Id

• One to many• An air item in Invoice has one or more matching (associated) records in

Segments

Page 25: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

25

Relational Database

Segment report with Commission

1. New query with Segment table

2. Add Invoice table, join, add commission fields

Page 26: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

26

Relational Database

Segment report with Commission - results

Page 27: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

27

Relational Database

Segment report with Commission – results

• 203.72 + 268.86 = 472.56• 23.63 + 23.63 + 23.63 + 23.63 = 94.52

Page 28: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

28

Relational Database

Segment report with Commission

• Calculate the commission per segment• New field with a name and the formula

Page 29: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

29

• 10.186 + 13.442 = 23.628

Page 30: 1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)

30

Copyright

Copyright

©2010 Travelport Inc. All rights reserved.  All Travelport logos and marks as well as all other Travelport proprietary materials depicted herein are the property of Travelport Inc. and/or its affiliates.

Notes About Examples

All screen examples and other inserts associated with system output are provided for illustration purposes only. They are

provided as illustrative examples of system functionality and are not meant to represent actual screen responses, rates,

etc.