CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'X11X1951'.. The SQL statement executed was: SELECT COUNT(*) FROM [dbo].[survey_489924] [t] WHERE ((((489924X11X1951 IS NULL) AND (489924X11X1952 IS NULL)) AND (489924X11X1953 IS NULL)) AND (489924X11X1954 IS NULL)) AND (489924X11X1955 IS NULL)

C:\limesurvey\framework\db\CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#2
+
 C:\limesurvey\application\helpers\admin\statistics_helper.php(2150): CActiveRecord->count(CDbCriteria)
2145             {
2146                 $criteria->addCondition($al[2] . " IS NULL");//$criteria->addCondition("\"" . $al[2] . "\" IS NULL");
2147             }
2148             if (incompleteAnsFilterState() == "incomplete") {$criteria->addCondition("submitdate IS NULL");}
2149             elseif (incompleteAnsFilterState() == "complete") {$criteria->addCondition("submitdate IS NOT NULL");}
2150             $multiNotDisplayed=Survey_dynamic::model($surveyid)->count($criteria);
2151             if (isset($_POST['noncompleted']) and ($_POST['noncompleted'] == "on") )
2152             {
2153                 //counter
2154                 $i=0;
2155                 while (isset($gdata[$i]))
#3
+
 C:\limesurvey\application\helpers\admin\statistics_helper.php(3322): statistics_helper->displayResults(array("alist" => array(array("1", "Add documents", "489924X11X1951"), array("2", "Add e-mails", "489924X11X1952"), array("3", "View documents", "489924X11X1953"), array("4", "Update/edit documents", "489924X11X1954"), ...), "qtitle" => "A2", "qquestion" => "How do you use Objective EDRMS? (Please select all that apply)", "qtype" => "M", ...), "11", "M489924X11X195", "html", ...)
3317                 $outputs=$this->buildOutputList($rt, $language, $surveyid, $outputType, $sql, $statlang);
3318                 $statisticsoutput .= $outputs['statisticsoutput'];
3319                 //2. Collect and Display results #######################################################################
3320                 if (isset($outputs['alist']) && $outputs['alist']) //Make sure there really is an answerlist, and if so:
3321                 {
3322                     $display=$this->displayResults($outputs, $results, $rt, $outputType, $surveyid, $sql, $usegraph, $browse, $statlang);
3323                     $statisticsoutput .= $display['statisticsoutput'];
3324                     $astatdata = array_merge($astatdata, $display['astatdata']);
3325                 }    //end if -> collect and display results
3326 
3327 
#4
+
 C:\limesurvey\application\controllers\admin\statistics.php(467): statistics_helper->generate_statistics("489924", array("idG", "idL", "datestampE", "datestampG", ...), array("idG", "idL", "datestampE", "datestampG", ...), 0, ...)
462             $outputType = $_POST['outputtype'];
463 
464             $helper = new statistics_helper();
465             switch($outputType){
466                 case 'html':
467                     $statisticsoutput .= $helper->generate_statistics($surveyid,$summary,$summary,$usegraph,$outputType,'DD',$statlang);
468                     break;
469                 case 'pdf':
470                     $helper->generate_statistics($surveyid,$summary,$summary,$usegraph,$outputType,'I',$statlang);
471                     exit;
472                     break;
2012-11-15 20:30:23 Microsoft-IIS/7.5 Yii Framework/1.1.10