store 2 records for future calculations
Hello, wondering if anyone can help me.
I have two queries on an asp page that i want to pull a record from each.
I then need to perform a calculation on the two records to give a total. for example output for calculation would be: rsItems10("sum") + rsItems11("sum") = n?
All calculations curently on the page remain, and need to be able to show the intended calculation as well as the others....
Any help would be appreciated
G.
Code:-
<%
Dim rsItems10
strSQL = "SELECT * FROM managingChangeQry"
Set rsItems10 = Server.CreateObject("ADODB.Recordset")
rsItems10.Filter = "sellerid = " & Session("PersonID")
rsItems10.Open strSQL, objConn
If Not rsItems10.EOF Then
If Session("PersonID") <> "" Then
Response.Write "<BR>"
End If
Do While Not rsItems10.EOF
If Session("PersonID") <> "" Then
Response.Write "<br>" & "(" & (FormatNumber((rsItems10("sum") / 28) * 100)) & "%" & ")"
Else
Response.Write "<br>" & "(" & (FormatNumber((rsItems10("sum") / 28) * 100)) & "%" & ")"
End If
rsItems10.MoveNext
Loop
rsItems10.close
Set rsItems10 = Nothing
Else
Response.Write "<CENTER>Questions not completed</CENTER>"
End If
Dim rsItems11
strSQL = "SELECT * FROM teamworkingQry"
Set rsItems11 = Server.CreateObject("ADODB.Recordset")
rsItems11.Filter = "sellerid = " & Session("PersonID")
rsItems11.Open strSQL, objConn
If Not rsItems11.EOF Then
If Session("PersonID") <> "" Then
Response.Write "<BR>Now Print out the results"
End If
Do While Not rsItems11.EOF
If Session("PersonID") <> "" Then
Response.Write "<br>" & "(" & (FormatNumber((rsItems11("sum") / 36) * 100)) & "%" & ")"
Else
Response.Write "<br>" & "(" & (FormatNumber((rsItems11("sum") / 36) * 100)) & "%" & ")"
End If
rsItems11.MoveNext
Loop
rsItems11.close
Set rsItems11 = Nothing
Else
Response.Write "<CENTER>Questions not completed</CENTER>"
End If
%>
|