var retData = ArrayNew(1); // Check if the question ID is defined if ( LEN(arguments.voteID) ) retData = application.ptPoll.cedata.getCEData(variables.voteElement, "ID", arguments.voteID); else retData = application.ptPoll.cedata.getCEData(variables.voteElement); // Return the data return retData; var retStatusStruct = "failed"; // Create the page retStatusStruct = application.ptPoll.csContent.populateContent(variables.voteCCAPI, arguments.dataValues); var retData = ArrayNew(1); // Check if the question ID is defined if ( LEN(arguments.questionID) ) retData = application.ptPoll.cedata.getCEData(variables.voteElement, "questionID", arguments.questionID); // Return the data return retData; SELECT * FROM #pollTableName# ORDER BY title, vote SELECT * FROM #pollTableName# ORDER BY title, vote SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '#tableViewName#' // Create the Poll Question View table application.ptPoll.cedata.buildRealTypeView(elementName="Poll Question"); // Create the Poll Vote View table application.ptPoll.cedata.buildRealTypeView(elementName="Poll Vote"); CREATE VIEW #tableViewName# AS SELECT TOP (100) PERCENT dbo.ce_Poll_QuestionView.title, dbo.ce_Poll_QuestionView.question, dbo.ce_Poll_VoteView.vote, dbo.ce_Poll_VoteView.date, dbo.ce_Poll_QuestionView.active FROM dbo.ce_Poll_QuestionView INNER JOIN dbo.ce_Poll_VoteView ON dbo.ce_Poll_QuestionView.ID = dbo.ce_Poll_VoteView.questionID ORDER BY dbo.ce_Poll_QuestionView.title, dbo.ce_Poll_VoteView.vote SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '#tableViewName#' CREATE VIEW #TableViewName# AS SELECT TOP (100) PERCENT title, question, vote, COUNT(vote) AS voteCount FROM #srcTableViewName# GROUP BY vote, title, question ORDER BY title, vote