executing a string ?

Results 1 to 2 of 2

Thread: executing a string ?

  1. #1
    Join Date
    Dec 1969

    Default executing a string ?

    i want to iterate through all the fields in a given recordset... what i want it to do is print out the value of the sum of the first field in each , then the 2nd field in each table.... i have 2 recordsets... RS1 and RS2 and have the following code...<BR><BR>SQL1 = Select * from table1 where id=1<BR>SQL2 = Select * from table2 where id=1<BR>Set RS1 = MyConn.Execute(SQL1)<BR>Set RS2 = MyConn.Execute(SQL2)<BR>&#039;Session("noofcolumns ") = number of columns in the tables<BR>For c = 1 To Session("noofcolumns")<BR> val1="RS1(data_col_" & c & ")"<BR> val2="RS2(ave_col_" & c & ")"<BR> num = num + val1 + val2<BR> Response.Write num + "<BR>"<BR>Next<BR><BR>is there an easier way to do this without having to execute a string ?

  2. #2
    Join Date
    Dec 1969

    Default what R U on about ????....

    The best way to do things like this is to try and get your sql code correct , so only the values U require are returned in a single recordset.<BR><BR>More information / table layout / sample data is required to progress

Posting Permissions

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