Skip to content

Commit

Permalink
Fixed issue #3973: Statistics fails on Multi Flexi question type on M…
Browse files Browse the repository at this point in the history
…SSQL DB

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8142 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Dec 11, 2009
1 parent a575146 commit 2ce2589
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions admin/statistics_function.php
Expand Up @@ -1778,7 +1778,7 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,

break;
}

echo '';
//loop thorugh the array which contains all answer data
foreach ($alist as $al)
{
Expand Down Expand Up @@ -1858,9 +1858,17 @@ function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0,
// ==> value is ''
// * NoAnswer due to conditions, or a page not displayed
// ==> value is NULL
$query = "SELECT count(*) FROM ".db_table_name("survey_$surveyid")." WHERE ".db_quote_id($rt)." IS NULL "
. "OR ".db_quote_id($rt)." = '' "
. "OR ".db_quote_id($rt)." = ' '";
if ($connect->databaseType == 'odbc_mssql' || $connect->databaseType == 'odbtp' || $connect->databaseType == 'mssql_n')
{
// mssql cannot compare text blobs so we have to cast here
$query = "SELECT count(*) FROM ".db_table_name("survey_$surveyid")." WHERE ".db_quote_id($rt)." IS NULL "
. "OR cast(".db_quote_id($rt)." as varchar) = '' "
. "OR cast(".db_quote_id($rt)." as varchar) = ' '";
}
else
$query = "SELECT count(*) FROM ".db_table_name("survey_$surveyid")." WHERE ".db_quote_id($rt)." IS NULL "
. "OR ".db_quote_id($rt)." = '' "
. "OR ".db_quote_id($rt)." = ' '";
}

}
Expand Down

0 comments on commit 2ce2589

Please sign in to comment.