Report Functions
Functions are mini-programs that can access information not available in the report cursor, format information in a specific manner, or perform calculations on report data.
A function consists of a name followed by a set of parenthesis. Within the parenthesis are function parameters—these are pieces of data that the function needs to process/return information. Some functions require one parameter only, others require several.
Take a look at these three simple functions to see examples of how a function should be written.
- ADDCRSE - returns a field from the Course table. You must pass it the course code field and the name of the field you want to return in quotes.
Example: ADDCRSE(cocrse,"codept") returns the course department.
- NICEDATE – returns the date in text format. You must pass it the date field. You can also pass it a second date and it will give you the date range in text format.
Example: NICEDATE(cobegdate) returns course begin date, e.g. December 1, 2002.
- GTDUE – returns total amount due for a registration. You must pass it the course code field and the name ID field.
Example: GTDUE(rgcrse,rgid) returns the total amount due for an individual in a specific course, e.g. 250.00.