Thanks to help here I was able to overcome some ivalid query errors. Now I'm back, (probably the same mistake) It's coming off of this line: $sql .= " And PostStart >= DATE_SUB(CurDate(), Interval ['search_fd1'] day )"; The 'search_fd1' is one of the form fields where a list of values is chosen from. Perhaps I will try the "search_optfd1" <?php if ((!isset($_GET["search_fd1"])) && (!isset($_POST["search_fd1"]))) { $itemvalue = ""; } else { $itemvalue = qsrequest("search_fd1"); } $cellvalue = "<select name=\"search_optfd1\"><option value=\"<=\"" . qscheckselected("<=",$arryopt[1],"selected") . ">less or equal</option></select> <select name=\"search_fd1\"><option value=\"\"" . qscheckselected("",$arryitemvalue[1],"selected") . ">Please Select</option>" . qsmysqlgen_listbox(" Select Distinct `DaysID`,`Days` From staDays ","search_fd1","DaysID","Days",$arryitemvalue[1]) . "</select>" . "<input type=\"hidden\" name=\"multisearch_fd1\" value=\"\">"; if ($cellvalue == "") { $cellvalue = " "; } print "<td class=" . $css_class . " align=Default >" . $cellvalue . "</td>"; ?> I hope my question makes sense. I didn't write this code AND I have little knowledge of PHP. Thank you, Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php