Adding DRW field values

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
 
S

Stefan B Rusynko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top