Change IFNULL to COALESE for MSSQL Compatibility - Fix #447

This commit is contained in:
Stephen Shkardoon 2016-03-22 12:17:04 +13:00
parent b825b6e42c
commit f1c84b0b25

View File

@ -165,7 +165,7 @@ class UserDefinedForm extends Page {
// get a list of all field names and values used for print and export CSV views of the GridField below. // get a list of all field names and values used for print and export CSV views of the GridField below.
$columnSQL = <<<SQL $columnSQL = <<<SQL
SELECT "SubmittedFormField"."Name" as "Name", "SubmittedFormField"."Title" as "Title", IFNULL("EditableFormField"."Sort", 999) AS "Sort" SELECT "SubmittedFormField"."Name" as "Name", "SubmittedFormField"."Title" as "Title", COALESCE("EditableFormField"."Sort", 999) AS "Sort"
FROM "SubmittedFormField" FROM "SubmittedFormField"
LEFT JOIN "SubmittedForm" ON "SubmittedForm"."ID" = "SubmittedFormField"."ParentID" LEFT JOIN "SubmittedForm" ON "SubmittedForm"."ID" = "SubmittedFormField"."ParentID"
LEFT JOIN "EditableFormField" ON "EditableFormField"."Title" = "SubmittedFormField"."Title" AND "EditableFormField"."ParentID" = '$parentID' LEFT JOIN "EditableFormField" ON "EditableFormField"."Title" = "SubmittedFormField"."Title" AND "EditableFormField"."ParentID" = '$parentID'