Adding DRW field values

  • Thread starter Thread starter Mick
  • Start date Start date
M

Mick

Hi, I have an Access database reporting to an ASP. I need to get a "sum" of
the values of a column of the DRW, but on the ASP rather than make Access do
the calculation, as I have already changed the field values on the ASP page
applying a manual calculation of the reported value using the following

<%
if FP_FieldVal(fp_rs,"xxx")= FP_FieldVal(fp_rs,"yyy") then
if FP_FieldVal(fp_rs,"zzz")= "Yes" then
dtjourneycost2 = FP_FieldVal(fp_rs,"journeycost")
else
dtjourneycost2 = FP_FieldVal(fp_rs,"journeycost") /2
end if
end if
%>
I would like to convert dtjourneycost2 to a number, then total up all the
results in the dtjourneycost2 column.
Many thanks for all your help
Mick
 
If your code is inside the Do Loop (getting each record) just add them using

<%
if FP_FieldVal(fp_rs,"xxx")= FP_FieldVal(fp_rs,"yyy") then
if FP_FieldVal(fp_rs,"zzz")= "Yes" then
dtjourneycost2 = FP_FieldVal(fp_rs,"journeycost")
else
dtjourneycost2 = FP_FieldVal(fp_rs,"journeycost") /2
end if
dtjourneycostsum = dtjourneycostsum + dtjourneycost2
end if
%>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi, I have an Access database reporting to an ASP. I need to get a "sum" of
| the values of a column of the DRW, but on the ASP rather than make Access do
| the calculation, as I have already changed the field values on the ASP page
| applying a manual calculation of the reported value using the following
|
| <%
| if FP_FieldVal(fp_rs,"xxx")= FP_FieldVal(fp_rs,"yyy") then
| if FP_FieldVal(fp_rs,"zzz")= "Yes" then
| dtjourneycost2 = FP_FieldVal(fp_rs,"journeycost")
| else
| dtjourneycost2 = FP_FieldVal(fp_rs,"journeycost") /2
| end if
| end if
| %>
| I would like to convert dtjourneycost2 to a number, then total up all the
| results in the dtjourneycost2 column.
| Many thanks for all your help
| Mick
 
Back
Top