store 2 records for future calculations
Hello, wondering if anyone can help me.
I have 2 queries within an asp page that i wish to pull one record from each, and then be able to add the two records together to create a total.
All the calculations on the page will remain as they are but i want to therefore be able to show a calculation similar to: rsItems10("sum") + rsItems11("sum") = ?
Does anyone know how to do this?
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>query 1"
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>query 2"
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
%>
|