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

Re: Running Totals (SQR 3.0.13.2), Oracle 7



SQR does not support pointers or references.  To my knowledge the only way
you can do this is to A) have an sqr (or another program) evaluate what
columns are needed and dynamically modify/create another SQR which is then
executed.  B) figure out your max number of columns and create a variable
for each possible column and programmatically control which variables are
incremented and printed (easier then it sounds).

There have been many times when references (perl style would be great) would
have been invaluable to me.  Hopefully it's in the cards for the future.

HTH,
John Milardovic

> -----Original Message-----
> From: Brown, Bryan [SMTP:bbrown2@ACSALASKA.COM]
> Sent: Monday, July 10, 2000 4:50 PM
> To:   SQR-USERS@list.iex.net
> Subject:      Running Totals (SQR 3.0.13.2), Oracle 7
>
> Hi gang,
>
> I have managed to create several reports without asking for help, but it
> is
> time once again to seek your wisdom....
>
> I am writing a report which duplicates a spreadsheet - there are running
> totals for both columns and rows. I am having difficulty with the totals
> for
> the columns. The program selects 1st by employee and second by date....
>
> The output looks like the following (the number of check dates may vary):
>
>             1/1/2000           1/15/2000   Total
> AAA     $                      $                Total for row
> BBB     $                      $                Total for row
> Total   total for column total for column
>
> I would like to great variables based on the check date, and then add the
> individual amounts to the variables.
>
> The example of what I want to accomplish is below. I do not know how to
> have
> a numeric variable created by the program. I can handle the "contents" of
> the variable, but how do I have the variable itself created? This may make
> no sense at all - if so, I appologize in advance :-)
>
> Thanks,
> Bryan
>
> begin-select
> a1.al_amount
> a1.check_dt
>
>    let #total-check-&a1.check_dt = #total-check-&a1.check_dt +
> &a1.check_dt
>
>    From PS_AL_CHK_DED A1
>       Where  a1.check_dt between $first_date and $second_date
>          and a1.al_dedcd = '64'
>          and a1.file_nbr = &a.file_nbr
>
> end-Select
>
>
>
> ------------------------------------------------------------
> Bryan E. Brown
> bbrown2@acsalaska.com, 907-564-1303
> Systems Analyst, ACS (Alaska Communication Systems)