How do I multiply two fields?

Thread: How do I multiply two fields?

1. Member
Join Date
Dec 1969
Posts
57

How do I multiply two fields?

I have one field that I need to have multiply with a number. I have no clue even where to start. I tried this:<BR>&#060;%=trim(RSbid("budget")) & "*" & trim(RSbid("probability"))%&#062;<BR>but all this does is put the two fields and the asterik in the table. Can anyone help?

2. Senior Member
Join Date
Dec 1969
Posts
1,175

RE: How do I multiply two fields?

&#060;%<BR>dim mybid,myprob,mytotal<BR>mybid = rsbid("budget")<BR>myprob = rsbid("probability")<BR>if (isNumeric(mybid) AND isNumeric(myprob)) then<BR> mybid = CDBL(mybid)<BR> myprob = CDBL(myprob)<BR> mytotal = (mybid * myprob)<BR> response.write mytotal<BR>end if<BR><BR><BR>%&#062;<BR>

3. Senior Member
Join Date
Dec 1969
Posts
1,016

RE: How do I multiply two fields?

&#060;%<BR>Dim budget,probability<BR>&#039;set variables<BR>budget=trim(RSbid("budget")<BR>probab ility=trim(RSbid("probability"<BR>answer=(budget*p robability)<BR>%&#062;<BR>There are numerous ways to use this kind of thing.<BR>Do While Not RSbid.eof etc...

4. Senior Member
Join Date
Dec 1969
Posts
1,016

5. Member
Join Date
Dec 1969
Posts
57

Thanks

6. Member
Join Date
Dec 1969
Posts
57

RE: How do I multiply two fields?

Thanks!

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•