Ok, looing at the example I found I needed more code:
if (empty($this->sql_search)) return $where;
// convert from string to an associative array
$fieldarray = where2array($this->sql_search, false, false);
if (!empty($fieldarray['date_from']) OR !empty($fieldarray['date_to'])) {
$fieldarray['fecnac'] = rangeFromTo($fieldarray['date_from'], $fieldarray['date_to'], true);
unset($fieldarray['date_from']);
unset($fieldarray['date_to']);
} // if
$this->sql_search = array2where($fieldarray);
Everything is working now, thanks.