Hi Dan

I had a quick look at your code and can't quite make it out but I hope
this helps:

Assuming you have an array with your many to one table course_fees and
your resultset of courses you could do:

<@rows>
<@ASSIGN local$course_revenue VALUE="<@FILTER ARRAY='local$revenue'
EXP='#1=<@COLUMN "Courses.CR_ID">'>">
<@assign local$total 0>
<@for start=1 stop=<@numrows array=local$course_revenue>>
        <@assign local$total <@calc
"@@local$total+@@local$course_revenue[<@currow>,2]">>
</@for>
</@rows>

I am not sure what DB you are using, however, if you want to return
totals with your data you should be able to do this with sql which will
be much more efficient.

Regards
Trevor

-----Original Message-----
From: Dan Stein [mailto:[EMAIL PROTECTED]] 
Sent: 17 September 2002 03:57 PM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: Help with report?

I am trying to output a break even report. It is a list of courses and
the
count of registrants.
Two tables are being searched in one action
Basket and courses
There is a one to many relationship between courses and basket.

I have no trouble pulling back the result set and then filtering it into
a
local array local$revenue so I know have two arrays one with all the
data
and a filtered local that is only courses actually paid for.

I have a Sum Calc that will total the fee's collected from the 11th
column
of the filtered array.

What I don't know how to do is to either create another array within the
loop that contains fees for the current course in the rows loop or do
somehow do a loop within the rows so I can sum the values for that
course.

It looks like I should be using a foe loop but I can't seems to get it
to
work

Results page is attached.

-- 
Dan Stein
Digital Software Solutions
799 Evergreen Circle
Telford PA 18969
Land: 215-799-0192
Mobile: 610-256-2843
Fax 413-410-9682
FMP, WiTango, EDI,SQL 2000
[EMAIL PROTECTED]
www.dss-db.com


________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to