Cause . . . . . : Field &2 in ordering item number &1 in format &3 is not valid for reason code &4. The reason codes and their meanings follow: 1 -- Field &2 with data type of datalink or XML is not allowed in an ordering expression. 2 -- SELECT DISTINCT is not allowed when not all ordering fields are in the select list. 3 -- Only fields which are grouping fields, or are fields that are mapped from a combination of grouping fields, literals, and grouping operators may be specified as ordering fields. 4 -- ORDER OF Item &1 is not allowed in an ordering expression.