Error during expression evaluation.
Function argument(s) expected in statement [SUM("<@__REF name=comp[*,1] userref=__C412D6385E9E64C83CEC4AB6>)]
The column is Compensation
The values are
1.5 Day Trade In
1.0 Day trade in
Etc.
We have to remove the text and leave the numbers or number and “.”
Maybe if there was and <@Keep> in the
<@ADDROWS local$comp <@TOKENIZE VALUE="<@VAR getdata[<@CURROW>7]>" CHARS=" ">>
Or maybe I was not clear in the 1st place..Column 7 of the table contain the values which are a mix of text and data . If this was to work without the addition of another column ( the solution for this table of static data) then those values would have to be parsed to numbers and then summed.
on 5/22/02 10:16 PM, John Hollister at [EMAIL PROTECTED] wrote:
Question? is this one field/column “1.5 Day trade in”
this is missing a “,”
<@VAR getdata[<@CURROW>,7]>"
and you show it in the 8 column but in the addrow <@VAR have it in the 7
here
<@CALC EXPR="SUM(@@local$sumhours[*,8])">
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Dan Stein
Sent: Wednesday, May 22, 2002 5:22 PM
To: Multiple recipients of list witango-talk
Subject: Re: Witango-Talk: MetaTag syntax question
I tried this but I get an error
</HEAD>
<BODY>
<@ASSIGN NAME="local$sumhours" VALUE="@@resultset" >
<@ASSIGN NAME="local$getdata" VALUE="@@resultset" >
<@FOR start=1 stop=<@NUMROWS ARRAY=local$getdata>>
<@ADDROWS local$comp <@TOKENIZE VALUE="<@VAR getdata[<@CURROW>7]>" CHARS=" ">>
</@FOR>
<table width="100%" border="1">
<tr bgcolor="#3333FF">
<td colspan="4" align=center><font color="#FFFFFF"><B> Dates and Times and
Compensation for <@COLUMN 'Courses.Title'></B></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td>Date</td>
<td>Time</td>
<td>Act 48 Hours</td>
<td>Compensation</td>
</tr>
<@ROWS>
<tr bgcolor="#CCCCCC">
<td><@COLUMN 'Course_CrossLink.Course_Date' FORMAT='Datetime:%A, %B %d, %Y'></td>
<td><@COLUMN 'Course_Times.Course_Time'></td>
<td><@COLUMN 'Course_CrossLink.Act48Hours'></td>
<td><@COLUMN 'Compensation.Compensation_Description'></td>
</tr>
</@ROWS>
<tr bgcolor="#CCCCCC">
<td></td>
<td><B>Totals</B></td>
<td><B><@CALC EXPR="SUM(@@local$sumhours[*,8])"></B></td>
<td><B><@CALC EXPR="SUM(@@local$comp[*,1])"> Day</B></td>
</tr>
</table>
<p><A HREF=""#"" Widow</A></p>
To be honest since there are only 10 possabilites I added a column with the numeric values to the database and just added that to my find so it looks like this. And it works perfect. But I would like to know what went wrong with your idea vsince it intrigued me and I would like to know how to do it in situations where the data I need to parse and sum is not static like this.
</HEAD>
<BODY>
<@ASSIGN NAME="local$sumhours" VALUE="@@resultset" >
<table width="100%" border="1">
<tr bgcolor="#3333FF">
<td colspan="4" align=center><font color="#FFFFFF"><B> Dates and Times and
Compensation for <@COLUMN 'Courses.Title'></B></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td>Date</td>
<td>Time</td>
<td>Act 48 Hours</td>
<td>Compensation</td>
</tr>
<@ROWS>
<tr bgcolor="#CCCCCC">
<td><@COLUMN 'Course_CrossLink.Course_Date' FORMAT='Datetime:%A, %B %d, %Y'></td>
<td><@COLUMN 'Course_Times.Course_Time'></td>
<td><@COLUMN 'Course_CrossLink.Act48Hours'></td>
<td><@COLUMN 'Compensation.Compensation_Description'></td>
</tr>
</@ROWS>
<tr bgcolor="#CCCCCC">
<td></td>
<td><B>Totals</B></td>
<td><B><@CALC EXPR="SUM(@@local$sumhours[*,8])"></B></td>
<@IF EXPR='<@CALC EXPR="SUM(@@local$sumhours[*,9])">>1'>
<td><B><@CALC EXPR="SUM(@@local$sumhours[*,9])"> Days</B></td>
<@ELSEIF EXPR='<@CALC EXPR="SUM(@@local$sumhours[*,9])">=1'>
<td><B><@CALC EXPR="SUM(@@local$sumhours[*,9])"> Day</B></td>
<@ELSE>
<td><td>
</@IF>
</tr>
</table>
<p><A HREF=""#"" Widow</A></p>
on 5/22/02 6:57 PM, John Hollister at [EMAIL PROTECTED] wrote:
<@ASSIGN local$getdata <@ARRAY VALUE=",,,,,,, 1.0 Day trade In;,,,,,,, 1.5 Day trade In;">>
<@FOR start=1 stop=<@NUMROWS ARRAY=local$getdata>>
<@addrows local$getnewarray <@TOKENIZE VALUE="<@VAR getdata[<@CURROW>,8]>" CHARS=" ">>
</@FOR>
<@CALC EXPR="SUM(@@local$getnewarray[*,1])">
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Dan Stein
Sent: Wednesday, May 22, 2002 12:31 PM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: MetaTag syntax question
I have a resultset that in one row returns data like this
1.0 Day trade In
1.5 Day trade in
In the last row of the table that shows this data I want to sum the hours so I want to add just the numbers. I have no problem with the Calc for the sum of the hours but can’t figure out how to do a sum for the numbers in the last column that has mixed text and numbers. I tried some things with the <@Keep> tag but it seems its not allowed with the Sum.
</HEAD>
<BODY>
<@ASSIGN NAME="local$sumhours" VALUE="@@resultset" >
<table width="100%" border="1">
<tr bgcolor="#3333FF">
<td colspan="4" align=center><font color="#FFFFFF"><B> Dates and Times and
Compensation for <@COLUMN 'Courses.Title'></B></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td>Date</td>
<td>Time</td>
<td>Act 48 Hours</td>
<td>Compensation</td>
</tr>
<@ROWS>
<tr bgcolor="#CCCCCC">
<td><@COLUMN 'Course_CrossLink.Course_Date' FORMAT='Datetime:%A, %B %d, %Y'></td>
<td><@COLUMN 'Course_Times.Course_Time'></td>
<td><@COLUMN 'Course_CrossLink.Act48Hours'></td>
<td><@COLUMN 'Compensation.Compensation_Description'></td>
</tr>
</@ROWS>
<tr bgcolor="#CCCCCC">
<td></td>
<td>Total Hours</td>
<td><@CALC EXPR="SUM(@@local$sumhours[*,8])"></td>
<td>(this is where the sum of compensation will go)</td>
</tr>
</table>
<p><A HREF=""#"" Widow</A></p>
--
Dan Stein
Digital Software Solutions
799 Evergreen Circle
Telford PA 18969
215-799-0192
610-256-2843
Fax 413-410-9682
FMP,Tango, EDI,SQL 7
[EMAIL PROTECTED]
www.dss-db.com
