Totals for the data in a specified attribute may be generated at the end of a report by including the TOTAL modifier in the query.
Format
TOTAL attribute [limiters] |
Parameter(s)
attribute |
Name of the attribute. |
limiters |
Totals only the data that matches the specified criteria. The criteria are expressed by a relational operator and a literal value enclosed in double quotes or backslashes. |
Description
At the end of the report, the total appears in the column of the specified attribute. The total is preceded and followed by a blank line, and is identified by three asterisks in the item-ID column.
The next example totals the sales to be entered and shows the last page of a weekly sales report:
>LIST ORDERS CUST.ID TITLE TOTAL TOTAL.AMT DBL-SPC |
|||
|
|
|
|
PAGE 3 |
11:02:44 DD MMM YYYY |
||
|
|
|
|
ORDERS |
Customer ID |
Title............... |
Amount |
|
|
|
|
10101 |
AJOHN5396 |
DATABASE MANAGEMENT SYSTEMS |
$19.90 |
|
|
|
|
10107 |
HJOHN7265 |
DATABASE MANAGEMENT SYSTEMS |
$727.05 |
|
|
OPERATING SYSTEM CONCEPTS |
|
|
|
|
|
10113 |
HJENK7129 |
OPERATING SYSTEM CONCEPTS |
$373.74 |
|
|
WORD PROCESSING |
|
|
|
|
|
10116 |
JBUCK6488 |
WORD PROCESSING |
$45.96 |
|
|
|
|
10122 |
JBUCK6488 |
WRITING COMMERCIAL APPLICATIONS |
$49.00 |
|
|
|
|
10110 |
JBOHA5422 |
OPERATING SYSTEM CONCEPTS |
$1301.13 |
|
|
WRITING COMMERCIAL APPLICATIONS |
|
|
|
WORD PROCESSING |
|
|
|
DATABASE MANAGEMENT SYSTEMS |
|
|
|
|
|
*** |
|
|
$5233.42 |
|
|
|
|
23 ITEMS LISTED |
|
|
The next example query totals only sales larger than $250.00 and shows the last page of the report:
>LIST ORDERS CUST.ID TITLE TOTAL TOTAL.AMT > "250.00" DBL-SPC |
|||
|
|
|
|
PAGE 3 |
10:41:14 DD MMM YYYY |
||
|
|
|
|
ORDERS |
Customer ID |
Title............... |
Amount |
|
|
|
|
10101 |
AJOHN5396 |
DATABASE MANAGEMENT SYSTEMS |
|
|
|
|
|
10107 |
HJOHN7265 |
DATABASE MANAGEMENT SYSTEMS |
$727.05 |
|
|
OPERATING SYSTEM CONCEPTS |
|
|
|
|
|
10113 |
HJENK7129 |
OPERATING SYSTEM CONCEPTS |
$373.74 |
|
|
WORD PROCESSING |
|
|
|
|
|
10116 |
JBUCK6488 |
WORD PROCESSING |
|
|
|
|
|
10122 |
JBUCK6488 |
WRITING COMMERCIAL APPLICATIONS |
|
|
|
|
|
10110 |
JBOHA5422 |
OPERATING SYSTEM CONCEPTS |
$1301.13 |
|
|
WRITING COMMERCIAL APPLICATIONS |
|
|
|
WORD PROCESSING |
|
|
|
DATABASE MANAGEMENT SYSTEMS |
|
|
|
|
|
*** |
|
|
$3600.15 |
|
|
|
|
23 ITEMS LISTED |
|
|
$3600.15 is the total figure for all sales larger than $250.00.
Note that data in the TOTAL.AMT column prints only for items that match the selection criteria.
See Formatting the Total for information on formatting totals.
See Also
Formatting INFO/ACCESS Reports