大象传媒

Reports

Reports are a mechanism for presenting information taken from a Queries created using SQL or QBE will return the results in a table structure. Reports have the advantage of preparing the data in a format that can be printed and allow sorting and

From our example, Vicki could prepare the report of customers living outside Belfast to be printed landscape on A4 paper, grouped by town and sorted alphabetically by surname.

The SQL query would be:

1 SELECT TblCustomers.FirstName, TblCustomers.LastName, TblCustomers.[Town/City]
2 FROM   TblCustomers
3 WHERE  (((TblCustomers.[Town/City]):< >"Belfast"))
  1. The Select statement selects the fields needed in the query
  2. The From statement selects the table
  3. The Where statement applies the criteria to the query

The QBE query would be:

Example of a QBE query

A can then be created based on this query. Database applications will allow users to group, sort and add headers and footers to the reports.

Example of the results of a QBE query
Figure caption,
Report grouped by Town/City and sorted by Surname, with the header 'Customer Living Outside Belfast', presented on landscape A4.

Complex reports also can include calculations. Database applications will provide functionality for basic mathematical functions (Sum, Avg, Max, Min, Count) within reports. In the example below, the sum function has been used to present monthly sales figures.

Example of a sum function in a database
Results of a sum function
  • Information is displayed simply and efficiently.
  • Reports can be printed from the database to view information quickly and easily.
  • If the user updates information in the database, the report can be recreated to contain the new information.
  • Reports can contain subtotals, counts and other powerful formulas that save time and allow greater analysis.
  • Graphical information including charts and graphs can collate, aggregate and summarise complex data sets.
  • Complex reports will include two or more of the following: grouping; sorting; calculations.