close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Question about Date Range Search with New (undocumented) Search Behaviour

Thread began 7/24/2017 10:26 am by Dave Buchholz | Last modified 7/24/2017 4:33 pm by Ray Borduin | 361 views | 6 replies |

Dave BuchholzBeta Tester

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

Sign in to reply to this post

Ray BorduinWebAssist

Can I get FTP access and a url to reproduce? I'll have to debug it.

Sign in to reply to this post

Dave BuchholzBeta Tester

Sure I will set up a test case for you and post the ftp details in a Pm

Sign in to reply to this post

Dave BuchholzBeta Tester

FTP & Link in PM

Sign in to reply to this post

Ray BorduinWebAssist

You have your comparison set to: "=<"

That isn't valid in MySQL, it should be: "<="

Sign in to reply to this post

Dave BuchholzBeta Tester

How on earth did I miss that, thank you Ray I obviously need a new pair of glasses!!

Sign in to reply to this post

Dave BuchholzBeta Tester

Just to follow up the search was still not working until I changed the "s" to "t" like so:

$search_rsDataSet->setSearch(array("type"=>"Value", "comparison"=>"<=", "join"=>"AND"), array("pbm.EffectiveDate"), "t", isset($_POST["effectivedate"])?$_POST["effectivedate"]:'');
$search_rsDataSet->setSearch(array("type"=>"Value", "comparison"=>">=", "join"=>"AND"), array("pbm.ExpirationDate"), "t", isset($_POST["effectivedate"])?$_POST["effectivedate"]:'');
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...