I have used this .asp to input search fields before but it was alway for text data. I cant get the right combination to do a search on a date range. Can anybody tell me where im going wrong?
--- i have a couple of input boxes to get a begin date and ----end date
<body onload=""document.searcher.search.focus()"> <p class="style17"> </p>
<form name="searcher action="<%=strURL %>" method=""get">
<div class="style18">
<span class="style17"">Begin Date:</span><input name="search_begin" value="<%=strsearch_begin %>" size="20" />
</div>
<center>
<div class="style18">
<span class="style17">End Date: </span>
<input name="search_end" "value="<%=strsearch_end %>" size="20" />
<input type="submit" />
</div>
</form>
<p class="style19"> [Enter Begin Date and End Date in format: (00/00/0000)]</p>
-- then i plug that input into my sql_str like this:
sql_str = "select count(det_placed)from gctab where det_placed = 'Y' and to_char(det_date,'mm/dd/yyyy') >= '" & (replace(strsearch_begin, "'", "''")) & "' "
set rs = myconnection.execute(sql_str)
det= rs(0)
rs.close
can anybody point me in the right direction to manage date's in this kind of situation?
--- i have a couple of input boxes to get a begin date and ----end date
<body onload=""document.searcher.search.focus()"> <p class="style17"> </p>
<form name="searcher action="<%=strURL %>" method=""get">
<div class="style18">
<span class="style17"">Begin Date:</span><input name="search_begin" value="<%=strsearch_begin %>" size="20" />
</div>
<center>
<div class="style18">
<span class="style17">End Date: </span>
<input name="search_end" "value="<%=strsearch_end %>" size="20" />
<input type="submit" />
</div>
</form>
<p class="style19"> [Enter Begin Date and End Date in format: (00/00/0000)]</p>
-- then i plug that input into my sql_str like this:
sql_str = "select count(det_placed)from gctab where det_placed = 'Y' and to_char(det_date,'mm/dd/yyyy') >= '" & (replace(strsearch_begin, "'", "''")) & "' "
set rs = myconnection.execute(sql_str)
det= rs(0)
rs.close
can anybody point me in the right direction to manage date's in this kind of situation?