Question about Date Range Search with New (undocumented) Search Behaviour
Ray,
I want to replicate a search from a site using DataAssist with the new MySQLi Behaviour and the one thing that I cannot get right is the date range search.
On the old site the code looks like this:
$WADbSearch1->addComparisonFromEdit("((pbm.EffectiveDate","effPromotionsDate","AND","<=",2);
$WADbSearch1->addComparisonFromEdit("pbm.ExpirationDate","effPromotionsDate","AND",">=",2);
My current code in MySQLi looks like this:
$search_rsProductListing->setSearch(array("type"=>"Value", "comparison"=>">=", "join"=>"AND"), array("pbm.EffectiveData"), "s", $showEffDate);
$search_rsProductListing->setSearch(array("type"=>"Value", "comparison"=>"=<", "join"=>"AND"), array("pbm.ExpirationDate"), "s", $showEffDate);
$showEffDate is 07/24/2017 in this instance
I have put the full query print out in a PM but the error I am getting reads:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=< ?) ORDER BY pkCategory, CommonBrandName, SeriesName, SKU, StandardColor ASC' at line 1
What do I need to change to get this to work ?
Thanks