<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial><SPAN class=877283918-24082010>This code works good
without the commented out lines, it searches and performs an AND subset of
records. When I remove the // from 7 and 8, the to and from work as
they are should when only those fields are entered. However, when any of
the other fields are entered, there are no results returned. I cannot
figure out why the DATEFROM and DATETO will not work with the other
fields. Is the syntax for <= and >= look ok?</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>$clauses = array();</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field == "TRS") {<BR> array_push($clauses,
"TRS like '%".$searchval."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field2 == "TR") {<BR> array_push($clauses,
"TR like '%".$searchval2."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field3 == "TRS_ORIG")
{<BR> array_push($clauses, "TRS_ORIG like
'%".$searchval3."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field4 == "DOCTYPE")
{<BR> array_push($clauses, "DOCTYPE like
'%".$searchval4."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field5 == "CREATOR")
{<BR> array_push($clauses, "CREATOR like
'%".$searchval5."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field6 == "DATE")
{<BR> array_push($clauses, "DATE like
'%".$searchval6."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>//if($field7 == "DATEFROM") {<BR>//
array_push($clauses, "DATEFROM >= '%".$searchval7."%'");<BR>//}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>//if($field8 == "DATETO") {<BR>//
array_push($clauses, "DATETO <= '%".$searchval8."%'");<BR>//}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>if($field9 == "YEAR")
{<BR> array_push($clauses, "YEAR like
'%".$searchval9."%'");<BR>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>$all_clauses = implode(" AND ",
$clauses);</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> $rs = $conn->Execute("SELECT * FROM
Surveyor_Image_Link WHERE ".$all_clauses." ORDER BY ".$sort."
ASC");</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV align=left>
<P align=left><FONT size=2 face=Arial>Jim Dahl, GISP<BR>GIS
Coordinator<BR>Douglas County Public Works<BR>526 Willow Dr<BR>PO Box
398<BR>Alexandria MN 56308</FONT></P>
<P><FONT size=2 face=Arial>V 320-762-2933<BR> 320-762-2999<BR>F
320-762-2998</FONT></P></DIV>
<DIV> </DIV></BODY></HTML>