Progress
Language Tutorial
for Windows


Reporting Information from One Table

First, the accounting department needs to sort out which customers have exceeded their credit limits or those who are close to exceeding the limits. All Around Sports wants accounting to look at all customers that have balances equal to or greater than 85 percent of their credit limits. All of this information is in the Customer table.

A single FOR EACH with a WHERE clause is what you need to gather this information. The code fragment below from lt-10-06.p shows this structure:

lt-10-06.p
        .
        .
        .
  FOR EACH Customer FIELDS (Balance Credit-Limit Name Contact)
      WHERE Balance >= (Credit-Limit * .85) 
      WITH STREAM-IO:
      DISPLAY Name FORMAT "x(20)" Contact FORMAT "x(15)" 
          Balance Credit-Limit WITH NO-BOX.
  END.    
        .
        .
        . 

The WHERE clause selects just the customers over the 85 percent threshold, and the DISPLAY statement outputs the key information about these customers. Running this procedure yields the output shown below:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095