= STR_TO_DATE('$dateofbirthFrom','%d-%m-%Y') ";How can I translate this ti the CC V5 where clause ? As per the document, a complex where condition can be added using colon, so I tried,$whereArray[":dateofbirth >= STR_TO_DATE('{$dateofbirthFrom}','%d-%m-%Y')"];and$whereArray[":dateofbirth_raw >= STR_TO_DATE('" . $dateofbirthFrom ."','%d-%m-%Y')"];but its not working. How do we use complex where clause in Chrono connectivity v5?"> Complex where clause in Chrono Connectivity V5 - Forums

Forums

Complex where clause in Chrono Connectivity V5

apurvkolte 21 Aug, 2015
I have a custom search form. The search form has a date input. I want to show records with date greater than the date in search input

i had this in CC V4, where we just echoed the where clause, the code looked like below

echo " AND `dateofbirth` >= STR_TO_DATE('$dateofbirthFrom','%d-%m-%Y') ";


How can I translate this ti the CC V5 where clause ? As per the document, a complex where condition can be added using colon, so I tried,

$whereArray[":dateofbirth >= STR_TO_DATE('{$dateofbirthFrom}','%d-%m-%Y')"];
and
$whereArray[":dateofbirth_raw >= STR_TO_DATE('" . $dateofbirthFrom ."','%d-%m-%Y')"];

but its not working.

How do we use complex where clause in Chrono connectivity v5?
apurvkolte 21 Aug, 2015
Answer
I found the answer.

i collected all the echoed strings to a string and the use colon while returning the array.
GreyHead 21 Aug, 2015
Hi apurvkolte,

I think that some PHP debugging is required here.

The syntax for a PHP array is => not >=

An array element uses () not []

This may be something closer to what you need
<?php
$dateofbirthFrom = ???;
return array( ":model.dateofbirth' = STR_TO_DATE('{$dateofbirthFrom}', '%d-%m-%Y') " );
?>

Bob

.

Bob
This topic is locked and no more replies can be posted.