(I am using this in an ASP page)
I am getting a recordset in line 10 and 20, but then I want to use the data in that recordset to create another recordset, is this possible?
Also should I be using the SUM function in lines 60 and 70.
(2 Tables: RegionalContracts and Reporting)
10 sqlStringa = "SELECT OrganizationID FROM RegionalContracts WHERE Region=" & "'" & strSelectedRegion & "'"
20 Set ReportRS = Con.Execute (sqlStringa)
(10 and 20 gives me a recordset of OrganizationID's)
30 WHILE NOT ReportRS.EOF
40 sqlStringb = "SELECT * FROM Reporting WHERE OrganizationID =" & ReportRS("OrganizationID"& " AND Year=" & strYear & " AND Quarter=" & strQuarter
50 Set Rst = Con.Execute (sqlStringb)
60 strTotalFiles = strTotalFiles + Rst(TotalFiles)
70 strActiveFiles = strActiveFiles + Rst(ActiveFiles)
80 ReportRS.MoveNext
90 WEND
Thanks for any help!
I am getting a recordset in line 10 and 20, but then I want to use the data in that recordset to create another recordset, is this possible?
Also should I be using the SUM function in lines 60 and 70.
(2 Tables: RegionalContracts and Reporting)
10 sqlStringa = "SELECT OrganizationID FROM RegionalContracts WHERE Region=" & "'" & strSelectedRegion & "'"
20 Set ReportRS = Con.Execute (sqlStringa)
(10 and 20 gives me a recordset of OrganizationID's)
30 WHILE NOT ReportRS.EOF
40 sqlStringb = "SELECT * FROM Reporting WHERE OrganizationID =" & ReportRS("OrganizationID"& " AND Year=" & strYear & " AND Quarter=" & strQuarter
50 Set Rst = Con.Execute (sqlStringb)
60 strTotalFiles = strTotalFiles + Rst(TotalFiles)
70 strActiveFiles = strActiveFiles + Rst(ActiveFiles)
80 ReportRS.MoveNext
90 WEND
Thanks for any help!