FIX : [ bug #1913 ] [EXPORT] [PGSQL] Bug when filtering export on a

specific year
This commit is contained in:
Florian HENRY 2015-03-30 19:13:55 +02:00
parent d0e4d8046b
commit 65ec02bae1

View File

@ -328,7 +328,7 @@ class Export
function conditionDate($Field, $Value, $Sens)
{
// TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN
if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." ".$Value;
if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." '".$Value."'";
elseif (strlen($Value)==6) $Condition=" date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'";
else $Condition=" date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value;
return $Condition;