creating queries and reports for list items. sample data cdcr data download relational database...

16
Building MS Access Reports Creating queries and reports for list items

Upload: shona-mccormick

Post on 12-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Building MS Access Reports

Creating queries and reports for list items

Page 2: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Data Structure Discussion Sample Data

• CDCR Data Download

Relational Database• Primary Key• Child Key• Lookup table

Page 3: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table
Page 4: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table
Page 5: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table
Page 6: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table
Page 7: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Query design

Page 8: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Query tricks for reports Concatenate

[LNAME] & ", " & [FNAME] & " " & [MNAME] "C:\Photos\" & [PAROLEE].[CDCNUM] & ".jpg"

Built-in and custom formulas• Date conversions

WeekdayName(Weekday([LASTCHANGEDATE])) MonthName(Month([LASTCHANGEDATE])) Year([LASTCHANGEDATE])

• Age calculations DateDiff("yyyy",[DOB],Date())-

IIf(Format([DOB],"mmdd")>Format(Date(),"mmdd"),1,0) INT(([DateOfReport]-[DOB])/365.25)

Page 9: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Query tricks for reports Concatenate

[LNAME] & ", " & [FNAME] & " " & [MNAME] "C:\Photos\" & [PAROLEE].[CDCNUM] & ".jpg"

Built-in and custom formulas• Date conversions

WeekdayName(Weekday([LASTCHANGEDATE])) MonthName(Month([LASTCHANGEDATE])) Year([LASTCHANGEDATE])

• Age calculations DateDiff("yyyy",[DOB],Date())-

IIf(Format([DOB],"mmdd")>Format(Date(),"mmdd"),1,0) INT(([DateOfReport]-[DOB])/365.25)

Page 10: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Where did you find that?

Page 11: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Report design

Page 12: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Report tricks Conditional formatting

• Highlight specific records

Sub-Reports• One-to-many relationships

Examples: SMT, Vehicles, Addresses, Conditions• Can grow/shrink

Page 13: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Advanced report design Back to SQL statements

• Left([RACE],1) • IIf([AGE]>=18,'A','J')• Left([HEIGHT],1) & "'" & Mid([HEIGHT],2,2) & Chr(34)

Other Functions• StrConv([LNAME] & ", " & [FNAME] & " " & [MNAME],3)

Page 14: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Adding photos to reports Best practices for photo storage and

database management• One photo per record

Multiple photos per person require a related table

• Thumbnail size version How to add photos in MS Access

2007 and newer versions

Page 15: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

How far can we go?

Page 16: Creating queries and reports for list items.  Sample Data CDCR Data Download  Relational Database Primary Key Child Key Lookup table

Questions? Contact Information

Matthew HarrisSonoma County Sheriff's [email protected]

Conan MullenSanta Rosa Police [email protected]