Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: How do I total this?


Message #1 by "Jose Haymaker" <ehaymaker@a...> on Wed, 14 Nov 2001 17:51:22
This pulls out all the data I want, and makes certain values negative, but 

how would I go about adding (agag + abab) into a single value?





for i=1 to columns 

     abba="a"&trim(str(i))&"domin" 

     adda="a"&trim(str(i))&"price" 

     acca="plusrminus"&i 

     myCommand6=NEW SQLCommand("SELECT "& adda &", "& acca &" from 

twothousanddescriptions WHERE vcode='9135' and prodid='911' and "& abba &" 

= '0'", myConnection) 

     myDataReader = myCommand6.ExecuteReader() 

     

    while myDataReader.Read() 

   

   if  (mydatareader.item("plusrminus"&i)) = "plus" then 

   

    response.write (" 

") 

    agag=(mydatareader.item("a"&trim(str(i))&"price")) 

    response.write (agag) 

     

   else 

    response.write (" 

") 

    abab=(mydatareader.item("a"&trim(str(i))&"price")) 

     

    response.write ("-" & abab) 

       

   end if 

   

end while 

    myDataReader.Close() 

    next 

  Return to Index