Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculation loop problem

Status
Not open for further replies.

jordan11

Technical User
May 24, 2003
150
GB
I have another problem with getting the correct results in my counter.

what I would like to happen is if the questionid in one table matches the questionid in a second table then i want to add 2 to the counter and then get the total at the end of the loop.
But what is actually happening is I am getting the total count of the actual questionid.
so i am getting 1+2+3+4 instead of 2+2+2+2

this is my code below

QUESTIONS=0
DO While not rt.EOF
O_questionID = cint(trim(rt("oQuestionID")))
if O_questionID = P_questionID then
question=question+2
else
question = question+2
end if
rt.movenext
loop

thanks
 
hm,
i dont see any error in the code that u have given.

but i do have one suggestion:
why not try an inner join?

Known is handfull, Unknown is worldfull
 
I found mistake had my counter set to questions and was looking for question
ignore this post
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top