IN reports, when using SUM(...) you must enclose the expression in
parentheses to tell the report generator that the expression is a SQL
statement..

vTotal = (SUM(whatever))

----- Original Message -----
From: J. Andrus <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 6:17 PM
Subject: RE: Report Totals


> Oma, Bill, Albert, & Dr.R.
> Unfortunately in my attempt to simplify the problem I left out a very
> important condition which, I think, means I will have to pursue Razzak's
> approach.
> I failed to mention that I need to meet the where condition "between two
> dates" where the computation is performed  for both A and B rather than
use
> all values for A and B types from the table, and I haven't been able to
> figure out how to incorporate such a condition into the vtot variable
> calculation
>
> Although it really doesn't matter if it is not possible to work the
"where"
> condition into the vtot variable calculation, In trying the
> "sum(IFEQ(colQ.........)" approach (assuming no where condition) I did
> encounter an error and can't see where I deviated from your examples.  The
> error message reads "Cannot recognize "OF" in sum of (2188)".  I
definitely
> didn't have "of" after sum.
>
> Thanks for your suggestions which are greatly appreciated.
> Jim
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Oma Cox
> > Sent: Wednesday, June 06, 2001 11:10 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Report Totals
> >
> >
> > Jim,
> >
> > If I understand your question is how to give a total for the items type
> > defined in colT  - A & B.
> > Define Report Var as follows:
> >
> > vtotA= sum (IFEQ(colT,'A',(colQ * colC),0))
> > vtotB= sum (IFEQ(colT,'B',(colQ * colC),0))
> >
> > If you have a lot of types or they are dynamic in nature then this means
> > adding a lot of var!
> > Adding the extra column and using code before the report is
> > generated is the
> > best bet if you don't have a fixed amount of types.
> >
> >
> > Best regards,
> >
> > Oma
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > Behalf Of J. Andrus
> > Sent: Wednesday, June 06, 2001 8:54 AM
> > To: RBase
> > Subject: Report Totals
> >
> >
> > RBWIN 2000, Ver 6.5+, Build 1.839xRT03
> >
> > Table: tablename
> > Columns: colC Currency, colQ Real, colT Text
> >
> > In the report based on tablename each detail line has a vtotal which is
> > (colQ * colC) where colT for that line can be any one, for simplicity,
of
> > two types, A or B.
> > Is it possible to show, in the report footer, the total for type A and
the
> > total for type B without adding a column to the table containing the
value
> > of (colQ * colC) or determining these two totals in a command
> > file prior to
> > running the report?
> >
> > Jim
> >
> >
>

Reply via email to