110 likes | 199 Views
CPSC 203 Introduction to Computers. T43, T46 & T68 By Jie (Jeff) Gao. Queries in Access. A query in Access is used to filter records and fields Only the fields and records which match the query are returned The data in a query’s view is from some table. Create a Query.
E N D
CPSC 203Introduction to Computers T43, T46 & T68 By Jie (Jeff) Gao
Queries in Access • A query in Access is used to filter records and fields • Only the fields and records which match the query are returned • The data in a query’s view is from some table CPSC 203 Tutorials by Jie Gao
Create a Query • Two ways: Wizard or Design View • Query Wizard can only create simple queries such as select part of the fields to display • Query Design View provides you the powerful interface to create various queries CPSC 203 Tutorials by Jie Gao
Query Design View • Select tables as data source • Select fields to display in the query: drag into a column in your query • Advanced: You can define new fields based on calculations of existing fields (like formulas in Excel) • Set criteria • =, >, <, …, e.g. >7.5 • and, or, …, e.g. >=200 and <300 CPSC 203 Tutorials by Jie Gao
Reports in Access • A report is an object in Access used to present data in a printed format • Data presented in a report is more understandable than the original data in tables • You have control over the size and appearance of everything included in a report CPSC 203 Tutorials by Jie Gao
Create a Report • Two ways in Access:Wizard or Design view • It is easy to create a report in wizard, but only some predefined format • Design view is more powerful, you can design the report style by yourself CPSC 203 Tutorials by Jie Gao
Using the Report Wizard • Select • Tables (queries) and their fields to appear in the report • How to group the records if you have multiple fields selected (e.g. put all CPSC courses together) • How to order the records, and summaries for some fields • Layout • Style • Name (also the title in your report) CPSC 203 Tutorials by Jie Gao
Using the Report Design View • Add fields on it • Decide how to group • Design headers and footers (report, page, group) • Set font and size • Background and colors • …… CPSC 203 Tutorials by Jie Gao
Create a Good Report • Maybe a good way: • First create in wizard • Then modify in design view • Provide sufficient descriptions for the report • Title • Date • Description and comments CPSC 203 Tutorials by Jie Gao
Assignment 3 • The three reports: • All fields and records in a report: you can create this directly from your data table • Employees who started after 01/01/94: you need a query to get the employee records, then create a report from the query • Employees who started after 01/01/94 and have a wage rate of more than 7: similar to 2, you need a query first • Pay attention to the ordering requirements • “After” and “More than” mean “>” CPSC 203 Tutorials by Jie Gao
Reading Week • No lectures or tutorials in reading week (next week) • The labs in Earth Sciences will be closed during the reading week • To use Access, you can go to the library and other open public labs CPSC 203 Tutorials by Jie Gao