</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
parse.txt
Description: MS-Word document
