PC Review


Reply
Thread Tools Rate Thread

Adding DRW field values

 
 
Mick
Guest
Posts: n/a
 
      5th Feb 2008
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
 
Reply With Quote
 
 
 
 
Stefan B Rusynko
Guest
Posts: n/a
 
      6th Feb 2008
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!" (-;
_____________________________________________


"Mick" <(E-Mail Removed)> wrote in message news:1B548875-F6DD-4747-B046-(E-Mail Removed)...
| 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


 
Reply With Quote
 
Mick
Guest
Posts: n/a
 
      6th Feb 2008
Hi stefan, cracking reply, worked first time. Many thanks Mick

"Stefan B Rusynko" wrote:

> 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!" (-;
> _____________________________________________
>
>
> "Mick" <(E-Mail Removed)> wrote in message news:1B548875-F6DD-4747-B046-(E-Mail Removed)...
> | 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Adding suffix to all the values in a field ( concatenate) Gina Whipp Microsoft Access Form Coding 0 20th Jan 2010 08:22 PM
Adding Field Values Srowe Microsoft Access Forms 3 16th May 2008 04:03 PM
Adding field values together =?Utf-8?B?Sm9obkI=?= Microsoft Access Reports 4 15th Nov 2005 04:42 PM
Adding calculated values into a table field??? =?Utf-8?B?V29ya3Nob3A=?= Microsoft Access 4 14th Mar 2005 06:06 PM
Adding Field Values to another Field Karan Microsoft Access 5 27th Mar 2004 09:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:57 AM.