From 468ebf4fcb9986ac771b8d3b259cc848dc0567cd Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 8 Jan 2010 03:03:35 +0000 Subject: [PATCH] BUGFIX Fixed mssql error when attempting to export data using SELECT DISTINCT query in SubmittedFormReportField --- code/submissions/SubmittedFormReportField.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/submissions/SubmittedFormReportField.php b/code/submissions/SubmittedFormReportField.php index 09f8593..ac9074d 100755 --- a/code/submissions/SubmittedFormReportField.php +++ b/code/submissions/SubmittedFormReportField.php @@ -83,7 +83,11 @@ class SubmittedFormReportField extends FormField { // Get the CSV header rows from the database - $tmp = DB::query("SELECT DISTINCT \"Name\", \"Title\" FROM \"SubmittedFormField\" LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\" WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ") ORDER BY \"SubmittedFormField\".\"ID\""); + $tmp = DB::query("SELECT DISTINCT \"SubmittedFormField\".\"ID\", \"Name\", \"Title\" + FROM \"SubmittedFormField\" + LEFT JOIN \"SubmittedForm\" ON \"SubmittedForm\".\"ID\" = \"SubmittedFormField\".\"ParentID\" + WHERE \"SubmittedFormField\".\"ParentID\" IN (" . implode(',', $inClause) . ") + ORDER BY \"SubmittedFormField\".\"ID\""); // Sort the Names and Titles from the database query into separate keyed arrays foreach($tmp as $array) {