I have 2 Calc elements in my candidates table.
One is the age of the candidate, calculated as such (thanks Hugh!)
$thendate = strtotime("{candidatos___dados_datanascimento}");
$nowdate = strtotime("today");
$datediff = ($nowdate - $thendate);
$diff = round($datediff / 31556926);
return $diff;
The other one assigns the candidate's age to one of two age brackets: less than 35 and more than 35 years old
$idade ="{candidatos___idade}";
if ($idade < 35) {
$idade2="<35";
}
else {
$idade2=">=35";
};
return $idade2;
The first one works fine in Fabrik and fine in an SQL query.
The second one displays fine in Fabrik but reutrn NULL in an SQL query.
Please help!
Thanks,
Mathieu
One is the age of the candidate, calculated as such (thanks Hugh!)
$thendate = strtotime("{candidatos___dados_datanascimento}");
$nowdate = strtotime("today");
$datediff = ($nowdate - $thendate);
$diff = round($datediff / 31556926);
return $diff;
The other one assigns the candidate's age to one of two age brackets: less than 35 and more than 35 years old
$idade ="{candidatos___idade}";
if ($idade < 35) {
$idade2="<35";
}
else {
$idade2=">=35";
};
return $idade2;
The first one works fine in Fabrik and fine in an SQL query.
The second one displays fine in Fabrik but reutrn NULL in an SQL query.
Please help!
Thanks,
Mathieu