$criteria_is_running->condition = ' (startDate IS NULL OR startDate <= :today) AND (stopDate IS NULL OR stopDate >= :today) ');
I have camel-case column names so they have to be escaped for Postgres to work. But if I add " " around the columns, it fails on MySQL because MySQL expects ` `
So I am now trying to rewrite my condition using CdbCriterias.
I tried it this way:
$criteria_is_running->addInCondition('startDate', array(null));
$criteria_is_running->addBetweenCondition('startDate', $nowDate->format('Y-m-d'), '1970-01-01', 'OR');
$criteria_is_running->addInCondition('stopDate', array(null), 'AND');
$criteria_is_running->addBetweenCondition('stopDate', '1970-01-01', $nowDate->format('Y-m-d'), 'OR');But this nests my conditions in a wrong way. How can I get this to work?
(((startDate IS NULL) OR (startDate BETWEEN :ycp0 AND :ycp1)) AND (stopDate IS NULL)) OR (stopDate BETWEEN :ycp2 AND :ycp3))
Anyone can help?

Help













