Hi folks, i have a Search asp page that the users input a startdate and and enddate and then displays the results from a query. Thats all good and works fine, but i am running into a problem when i want to include a second query in my Search and display it.
Here is some code:
Code:
<%
select case request.querystring("Action")
case "Search"
StartDate = Request("startdate")
EndDate= Request("enddate")
sql="SELECT * FROM STAServicesQuery WHERE STADate BETWEEN #" & StartDate & "# AND #" & EndDate & "# ORDER BY ""STADate"" ASC "
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
end select
%>
<%
Select case request.querystring("Action")
case "Search"
%>
and i display my resulting data using:
Code:
<% Do While Not RS.EOF %>
<tr VALIGN="TOP">
<td><%Response.Write RS("STADate")%></td>
<td><%Response.Write RS("FullName")%></td>
<td><%Response.Write RS("Code")%></td>
<td><%Response.Write RS("Comments")%></td>
</tr>
<% RS.MoveNext %><% loop %>
</table>
<% case else%>
What i want to do is include a second query in my search 'STAInboundQuery', so i thought i could just duplicate my sql stmt as so
Code:
sql2="SELECT * FROM STAInboundQuery WHERE STADate BETWEEN #" & StartDate & "# AND #" & EndDate & "# ORDER BY ""STADate"" ASC "
and then display these in my table as well, but i am not sure how to do this? Will the sql2 stmt be enough? Do i need a 'set rs2 = ......' and an 'rs2.Open sql2 ...' line as well
I am not sure how to do what i want to do
any help would be great thanks!!!!