Hi All,
I have a form that populates search criteria in a query query. I want the user to be able to select a date range if they want to but also be able to use other search criteria and not use the range. My query seems to only be working if the date range fields are filled. Otherwise no results are being returned. I have used IS NULL before but that was in MS Access. It doesn't seem to be working here but I am probably not using it correctly. How would I do this in MySQL? Here is the query:
Thanks!
Ken
I have a form that populates search criteria in a query query. I want the user to be able to select a date range if they want to but also be able to use other search criteria and not use the range. My query seems to only be working if the date range fields are filled. Otherwise no results are being returned. I have used IS NULL before but that was in MS Access. It doesn't seem to be working here but I am probably not using it correctly. How would I do this in MySQL? Here is the query:
SQL:
$query ="SELECT *
FROM tblequipissues
WHERE Location LIKE '%$Location%' AND
LocationNum LIKE '%$LocationNum%' AND
EquipType LIKE '%$EquipType%' AND
UnitNo LIKE '%$EquipNum%' AND
IssueDate BETWEEN '$FromIssueDate' AND '$ToIssueDate' AND
EnteredBy LIKE '%$EnteredBy%' AND
FixedBy LIKE '%$Assigned%'";
Thanks!
Ken