Skip to content

Commit

Permalink
Fixed issue: Randomization groups for questions not working when usin…
Browse files Browse the repository at this point in the history
…g MSSQL
  • Loading branch information
c-schmitz committed Oct 9, 2012
1 parent 8b803d1 commit c28ab69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ function buildsurveysession($surveyid,$previewGroup=false)
$randomGroups=array();
if (in_array(Yii::app()->db->getDriverName(), array('mssql', 'sqlsrv')))
{
$rgquery = "SELECT attr.qid, CAST(value as varchar(255)) FROM {{question_attributes}} as attr right join {{questions}} as quests on attr.qid=quests.qid WHERE attribute='random_group' and CAST(value as varchar(255)) <> '' and sid=$surveyid GROUP BY attr.qid, CAST(value as varchar(255))";
$rgquery = "SELECT attr.qid, CAST(value as varchar(255)) as value FROM {{question_attributes}} as attr right join {{questions}} as quests on attr.qid=quests.qid WHERE attribute='random_group' and CAST(value as varchar(255)) <> '' and sid=$surveyid GROUP BY attr.qid, CAST(value as varchar(255))";
}
else
{
Expand Down

0 comments on commit c28ab69

Please sign in to comment.