Merge pull request #2508 from FHenry/3.6

FIX : [ bug #1913 ] [EXPORT] [PGSQL] Bug when filtering export on a specific year
This commit is contained in:
Laurent Destailleur 2015-04-02 11:22:18 +02:00
commit f38212f20e

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;