Skip to content

Commit

Permalink
Merge pull request #2508 from FHenry/3.6
Browse files Browse the repository at this point in the history
FIX : [ bug #1913 ] [EXPORT] [PGSQL] Bug when filtering export on a specific year
  • Loading branch information
eldy committed Apr 2, 2015
2 parents fd8d09c + 65ec02b commit f38212f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/exports/class/export.class.php
Expand Up @@ -328,7 +328,7 @@ function build_filterQuery($TypeField, $NameField, $ValueField)
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;
Expand Down

0 comments on commit f38212f

Please sign in to comment.