Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrievin information by date frm the database

Status
Not open for further replies.

psyren

Technical User
Jul 21, 2003
22
SG
can u debug this statement..... i dunno why i cant display the dates...... i have 2 drop down boxes ....one displayin the mth and the other year.....

<select name=&quot;sel_month&quot; size=&quot;1&quot;>
<% Do until rs.EOF %>
<option value='<%=rs(&quot;id&quot;)%>' selected><%=rs(&quot;mnth&quot;)%></option>
<% rs.MoveNext %>
<% loop %>
</select>
<%
rs.close
rs.open &quot;SELECT * FROM years &quot;, obconn
%>
<select name=&quot;sel_year&quot; size=&quot;1&quot;>
<% Do until rs.EOF %>
<option value='<%=rs(&quot;year&quot;)%>' selected><%=rs(&quot;year&quot;)%></option>
<% rs.MoveNext %>
<% loop %>
</select>



this is the page where u should display the information where u choose the specific dates...
<%
set Sdate =&quot;1/&quot; & request.querystring(&quot;sel_month&quot;)
set Edate =&quot;31/&quot; & request.querystring(&quot;sel_month&quot;)

response.write(Sdate)
response.write(Edate)

Dim obconn, obrs

set obconn=Server.CreateObject(&quot;ADODB.Connection&quot;)
obconn.Provider=&quot;Microsoft.Jet.OLEDB.4.0&quot;
obconn.Open(Server.Mappath(&quot;../database/ertDB.mdb&quot;))
set obrs=Server.CreateObject(&quot;ADODB.Recordset&quot;)


if request.querystring(&quot;select2&quot;)=&quot;1&quot; then

if request.querystring(&quot;CHOICE3&quot;)<>&quot;&quot; then
obrs.open &quot;SELECT * FROM posts WHERE title LIKE '%&quot; & request.querystring(&quot;Title&quot;) & &quot;%'&quot;, obconn
end if

if request.querystring(&quot;choice2&quot;)<>&quot;&quot; then
obrs.open&quot;SELECT * FROM posts WHERE date BETWEEN '&quot; & request.querystring(&quot;select&quot;) & &quot;'&quot;, obconn
end if

if request.querystring(&quot;choice&quot;)<>&quot;&quot; then
obrs.open&quot;SELECT * FROM posts WHERE title LIKE '&quot; & request.querystring(&quot;search&quot;) & &quot;%'&quot;, obconn
end if

if obrs.EOF then
response.write(&quot;<br>The information '&quot; & request.querystring(&quot;Title&quot;) & &quot;' you are searching in News and Updates is not unavailable in our database!!! <br> Plesase try again!!&quot;)
else

Do until obrs.EOF %>
 
this part is not working?
or if not give me the part that is not working... and what is the error? does it simply dispay only empty drpdowns?
<select name=&quot;sel_month&quot; size=&quot;1&quot;>
<% Do until rs.EOF %>
<option value='<%=rs(&quot;id&quot;)%>' selected><%=rs(&quot;mnth&quot;)%></option>
<% rs.MoveNext %>
<% loop %>
</select>
<%
rs.close
rs.open &quot;SELECT * FROM years &quot;, obconn
%>
<select name=&quot;sel_year&quot; size=&quot;1&quot;>
<% Do until rs.EOF %>
<option value='<%=rs(&quot;year&quot;)%>' selected><%=rs(&quot;year&quot;)%></option>
<% rs.MoveNext %>
<% loop %>
</select>





Known is handfull, Unknown is worldfull
 
I'm trying to figure out how to use a search to find dates that i wanted. I kinda deleted the prvious things that i created and would like to knoe any gd way to get a searchpage to retrieve dates but still i got to choose either one tables at a time to display its dates.. i have one frm an upload table and the other a hyperlink table.. ThankS!~~


this if jush the layout i'm showin if u care to see it then:

<!-- #include file = &quot;../includes/header-includes.asp&quot; -->

<html>

<head>
<meta http-equiv=&quot;Content-Language&quot; content=&quot;en-us&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 5.0&quot;>
<meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;>
<title>New Page 1</title>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>

<form method=&quot;get&quot; action=&quot;asp/search_result.asp&quot;>
<!--webbot bot=&quot;SaveResults&quot; u-file=&quot;fpweb:///_private/form_results.csv&quot; s-format=&quot;TEXT/CSV&quot; s-label-fields=&quot;TRUE&quot; -->
<div id=&quot;Layer1&quot; style=&quot;position:absolute; width:169px; height:65px; z-index:1; top: 487px; left: 696px;&quot;>
<p><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;></p>
<p><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;><img src=&quot;assets/graphix/misc/arrow1.gif&quot; width=&quot;24&quot; height=&quot;21&quot;></p>
</div>
<div id=&quot;Layer2&quot; style=&quot;position:absolute; width:335px; height:41px; z-index:2; top: 488px; left: 358px;&quot;>
<h6 align=&quot;right&quot;><font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Press
'REFRESH' on the web browser to reset the search..</font></h6>
</div>
<table width=&quot;78%&quot;>
<tr>
<td width=&quot;36%&quot;><TABLE width=&quot;264&quot; height=&quot;170&quot; border=0 align=&quot;left&quot; cellPadding=0 cellSpacing=0>
<tr>
<TD class=rowHdr vAlign=top align=center width=10 bgcolor=&quot;#6699CC&quot;>
<IMG height=10 src=&quot;assets/graphix/hpPortal/top_left_trans_small.gif&quot; width=10 border=0></TD>
<td width=&quot;244&quot; align=&quot;center&quot; bgcolor=&quot;#6699CC&quot;> <div align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#FFFFFF&quot;><strong>Searching
For </strong></font><strong><font color=&quot;#FFFFFF&quot;></font></strong></div></td>
<TD class=rowHdr vAlign=top align=center width=10 bgcolor=&quot;#6699CC&quot;>
<IMG height=20 src=&quot;assets/graphix/hpPortal/top_right_trans.gif&quot; width=10 border=0></TD>
</tr>
<tr>
<td width=&quot;10&quot; height=&quot;142&quot; align=&quot;center&quot; bgcolor=&quot;#EBEBEB&quot;></td>
<td width=&quot;244&quot; align=&quot;center&quot; bgcolor=&quot;#EBEBEB&quot;> <h5 align=&quot;left&quot;>
<br>
<select name=&quot;select2&quot; size=&quot;1&quot;>
<option value=&quot;1&quot; selected>News and Updates</option>
<option value=&quot;2&quot;>Resource Center</option>
<option value=&quot;3&quot;>Favourites</option>
<option value=&quot;4&quot;>Meeting Minutes</option>
</select>
</h5>
<h6 align=&quot;left&quot;><font face=&quot;Arial&quot;>*Select the drop down button
and proceed to Search By Title or Search By Date or even in Alphabetical
Order</font> </h6>
<h6></h6></td>
<td bgcolor=&quot;#EBEBEB&quot; width=&quot;10&quot; align=&quot;center&quot;></td>
</tr>
<TD bgcolor=&quot;#EBEBEB&quot; class=Regular vAlign=top align=center width=10>
<IMG height=10 src=&quot;assets/graphix/hpPortal/btm_left_trans.gif&quot; width=10></TD>
<td bgcolor=&quot;#EBEBEB&quot; width=&quot;244&quot; align=&quot;center&quot;></td>
<TD bgcolor=&quot;#EBEBEB&quot; class=Regular vAlign=top align=center width=10>
<IMG height=10 src=&quot;assets/graphix/hpPortal/btm_right_trans.gif&quot; width=10></TD>
</tr>
</table></td>
<td width=&quot;64%&quot;><TABLE width=&quot;485&quot; height=&quot;170&quot; border=0 cellPadding=0 cellSpacing=0>
<tr>
<TD width=10 height=&quot;20&quot; align=left vAlign=top bgcolor=&quot;#6699CC&quot; class=rowHdr>
<IMG height=10 src=&quot;assets/graphix/hpPortal/top_left_trans_small.gif&quot; width=10 border=0></TD>
<td width=&quot;457&quot; align=&quot;center&quot; bgcolor=&quot;#6699CC&quot;> <div align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#FFFFFF&quot;><strong>Search
By Alphabetical Order </strong></font></div></td>
<TD class=rowHdr vAlign=top align=left width=10 bgcolor=&quot;#6699CC&quot;>
<IMG height=20 src=&quot;assets/graphix/hpPortal/top_right_trans.gif&quot; width=10 border=0></TD>
</tr>
<tr>
<td width=&quot;10&quot; height=&quot;142&quot; bgcolor=&quot;#EBEBEB&quot;></td>
<td width=&quot;460&quot; align=&quot;center&quot; bgcolor=&quot;#EBEBEB&quot;> <h5 align=&quot;left&quot;>
<select name=&quot;Search&quot; size=&quot;1&quot;>
<option value=&quot;A&quot; selected>A</option>
<option value=&quot;B&quot;>B</option>
<option value=&quot;C&quot;>C</option>
<option value=&quot;D&quot;>D</option>
<option value=&quot;E&quot;>E</option>
<option value=&quot;F&quot;>F</option>
<option value=&quot;G&quot;>G</option>
<option value=&quot;H&quot;>H</option>
<option value=&quot;I&quot;>I</option>
<option value=&quot;J&quot;>J</option>
<option value=&quot;K&quot;>K</option>
<option value=&quot;L&quot;>L</option>
<option value=&quot;M&quot;>M</option>
<option value=&quot;N&quot;>N</option>
<option value=&quot;O&quot;>O</option>
<option value=&quot;P&quot;>P</option>
<option value=&quot;Q&quot;>Q</option>
<option value=&quot;R&quot;>R</option>
<option value=&quot;S&quot;>S</option>
<option value=&quot;T&quot;>T</option>
<option value=&quot;U&quot;>U</option>
<option value=&quot;V&quot;>V</option>
<option value=&quot;W&quot;>W</option>
<option value=&quot;X&quot;>X</option>
<option value=&quot;Y&quot;>Y</option>
<option value=&quot;Z&quot;>Z</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=&quot;submit&quot; value=&quot;Go>>&quot; name=&quot;CHOICE&quot;>
</h5>
<h6 align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot;>*Select
the alphabet of any title to begin the search</font></h6>
<p> </td>
<td bgcolor=&quot;#EBEBEB&quot; width=&quot;10&quot;></td>
</tr>
<tr>
<TD bgcolor=&quot;#EBEBEB&quot; class=Regular vAlign=top align=left width=10>
<IMG height=10 src=&quot;assets/graphix/hpPortal/btm_left_trans.gif&quot; width=10></TD>
<td bgcolor=&quot;#EBEBEB&quot; width=&quot;457&quot;></td>
<TD bgcolor=&quot;#EBEBEB&quot; class=Regular vAlign=top align=right width=10>
<IMG height=10 src=&quot;assets/graphix/hpPortal/btm_right_trans.gif&quot; width=10></TD>
</tr>
</table></td>
</tr>
</table>
<table width=&quot;78%&quot;>
<tr>
<td><TABLE width=&quot;760&quot; height=&quot;150&quot; border=0 cellPadding=0 cellSpacing=0>
<tr>
<TD class=rowHdr vAlign=top align=left width=10 bgcolor=&quot;#6699CC&quot;>
<IMG height=10 src=&quot;assets/graphix/hpPortal/top_left_trans_small.gif&quot; width=10 border=0></TD>
<td width=&quot;730&quot; align=&quot;center&quot; bgcolor=&quot;#6699CC&quot;> <div align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; color=&quot;#FFFFFF&quot;><strong>Search
by Title</strong></font></div></td>
<TD class=rowHdr vAlign=top align=left width=10 bgcolor=&quot;#6699CC&quot;>
<IMG height=20 src=&quot;assets/graphix/hpPortal/top_right_trans.gif&quot; width=10 border=0></TD>
</tr>
<tr>
<td width=&quot;10&quot; height=&quot;142&quot; bgcolor=&quot;#EBEBEB&quot;></td>
<td width=&quot;730&quot; align=&quot;center&quot; bgcolor=&quot;#EBEBEB&quot;> <h5 align=&quot;left&quot;><span style=&quot;font-weight: 400&quot;>
&nbsp;</span>
<input type=&quot;text&quot; name=&quot;Title&quot; size=&quot;80&quot;>
&nbsp;&nbsp;&nbsp;&nbsp;
<input type=&quot;submit&quot; value=&quot;Search&gt;&gt;&quot; name=&quot;CHOICE3&quot;>
</h5>
<h6 align=&quot;left&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot;>*Type
words or sentences to search the appropriate topic</font></h6>
<h6> </h6></td>
<td bgcolor=&quot;#EBEBEB&quot; width=&quot;10&quot;></td>
</tr>
<tr>
<TD width=10 height=&quot;8&quot; align=left vAlign=top bgcolor=&quot;#EBEBEB&quot; class=Regular>
<IMG height=10 src=&quot;assets/graphix/hpPortal/btm_left_trans.gif&quot; width=10></TD>
<td bgcolor=&quot;#EBEBEB&quot; width=&quot;730&quot;></td>
<TD bgcolor=&quot;#EBEBEB&quot; class=Regular vAlign=top align=right width=10>
<IMG height=10 src=&quot;assets/graphix/hpPortal/btm_right_trans.gif&quot; width=10></TD>
</tr>
</table></td>
</tr>
</table>
<TABLE width=&quot;265&quot; height=&quot;150&quot; border=0 align=&quot;left&quot; cellPadding=0 cellSpacing=0>

</table>
<p>&nbsp;</p>
</form>


</body>

</html>
<!-- #include file = &quot;../includes/footer-includes.asp&quot; -->
 
can u be a bit more clear? are u trying to build a query dynamically using an interface?

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top