Description

The Limit keyword restricts the output of data from a multi-valued column to those values that meet specified criteria.

Syntax

Limit [CaseSens | CaseInsens] COLUMN comparison [value | compare]

- OR -

Limit COLUMN range

Remarks

Limiting ("print limiting") is useful when you want to display only a portion of a multi-valued column. If the column is displayed normally, the entire contents of the multi-valued column will be displayed for each row. By specifying Limit criteria, however, you can instruct the report to output only those values in the multi-valued column that meet criteria you establish. Limit works like a With clause, but applies only to the display of values for one column. With selects rows out of the entire table for processing; Limit selects values out of one column for display.

ParameterDescription
CaseSensUse the CaseSens keyword to force a case-sensitive search of data
CaseInsensUse the CaseInsens keyword to force a case-insensitive search of data.
comparisonThe comparison operation that is to take place. The same comparison operators (Eq, =, GT, >, etc.) are available as in With clauses. The default is Eq. For details on possible values for the compare word, refer to With.
valueRepresents the value against which each value in the multi-valued column is to be compared. The value should be enclosed in quotes if it is non-numeric. An example of a value comparison is:

List CUSTOMERS Limit INV_DATE > "1-1-95"

compareYou can also compare column with another column in the table. Each value of the multi-valued column will be compared against the value in the compare.column. For example:

List CUSTOMERS Limit PAID_DATE > DUE_DATE

rangeThe range specifies a set of acceptable values that can be met for the data to be displayed. The range takes the form:

From value To value

- OR -

Between value And value

Examples

Some examples:

List CUSTOMERS Limit INVOICE_DATE From "1-1-95" TO "12-31-95"
List CUSTOMERS Limit INVOICE_AMOUNT Between 1000 And 5000

Each value in the multi-valued column will be compared to the range. If the value in the column falls within the range specified by the range (inclusive), it will be displayed.

This command lists the company name of all customers. In addition, all invoice amounts of $1,000 or greater in the multi-valued column INVOICE_AMOUNT are displayed. Invoice amounts of less than $1,000 are not displayed, even though they may exist.

List CUSTOMERS COMPANY Limit INVOICE_AMOUNT >= "1000"

This command lists the company name of all customers, and lists all values from the multi-valued column INVOICE_PAID_DT in which the date is greater than the contents of the column INVOICE_DUE_DT.

List CUSTOMERS COMPANY Limit INVOICE_PAID_DT GT INVOICE_DUE_DT

This command lists the company name of all customers, and displays all of the values from the multi-valued column INVOICE_DATE in which the value falls into the range of 1-1-95 to 12-31-95 (inclusive).

List CUSTOMERS COMPANY Limit INVOICE.DATE From "1-1-95" To "12-31-95"
* Run_Report examples
 
* Display all Orders and display only Item 3542-1-310-1 from the
* multivalue list.
 
stmt = 'LIST ORDERS CUSTOMER_NAME ITEM DESCRIPTION '
stmt:= ' LIMIT ITEM "3542-1-310-1"'
Run_Report("",stmt)
 
* Display only Orders containing Item 3542-1-310-1 and display only
* Item 3542-1-310-1 from the multivalue list.
 
stmt = 'LIST ORDERS CUSTOMER_NAME ITEM DESCRIPTION '
stmt:= ' LIMIT ITEM "3542-1-310-1" WITH ITEM [] "3542-1-310-1"'
Run_Report("",stmt)