[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Effective dated entries and totals etc.



In a message dated 96-12-03 23:52:58 EST, you write:

<< I am writing a report that will include effective dated records.
 Requirements I have questions on are
         1. How to easily keep totals against current effective date salary
values
         2. How to print a field (employee position) below another field
(name)

 A simplified example of the report follows;

 --- start report ---
 Department:  Executive

 Name            Effdt           Salary
 Fred            10/20/96        $14,000
 President       11/01/96        $18,000
                 11/13/96        $22,000

 Sam             10/20/96        $12,000
 V.P.

 Department Total $34,000
 --- end report ---
  >>

For complex reports (and I mean those where straight SQR break logic cannot
be used) I tend to extract the information to a Sybase Extract Table (or Unix
file) and then read it back in to report from it.

In this case your extract table could be as follows:

create extract_table
    department  char(10)
    name          char(10)
    title             char(10)
    effdt           date
    salary         money

1) Read your main file and extract the detail information to the extract
table
2) read the extract file (sorted in the order you want) back in and use break
logic to process it or just handle your own breaks.

It may take more code - but is simple, easy to understand and it works every
time :)

Fernando A. Villaamil
Miami Herald Publishing Company
fvillaamil@aol.com