title: caml query error: The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator
body: <p>When doing a orderby by for a sharepoint field. The error below is generated:</p>
  
  <p>The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <p>Exception Details: System.Data.SqlClient.SqlException: The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.</p>
  
  <p>The CAML query orderby clause is as follows:</p>
  
  <pre><code>&lt;Where&gt;
    &lt;And&gt;
      &lt;And&gt;
        &lt;Eq&gt;
          &lt;FieldRef Name='ContentType' /&gt;
          &lt;Value Type='Choice'&gt;Documents&lt;/Value&gt;
        &lt;/Eq&gt;
        &lt;Eq&gt;
          &lt;FieldRef Name='UserID' /&gt;
          &lt;Value Type='Text'&gt;UserID_VAL&lt;/Value&gt;
        &lt;/Eq&gt;
      &lt;/And&gt;
      &lt;Neq&gt;
        &lt;FieldRef Name='Email' /&gt;
        &lt;Value Type='Text'&gt;NA&lt;/Value&gt;
      &lt;/Neq&gt;
    &lt;/And&gt;
  &lt;/Where&gt;
  &lt;OrderBy&gt;
    &lt;FieldRef Name='Description' Ascending='TRUE'  Nullable='TRUE'/&gt;
  &lt;/OrderBy&gt;
  </code></pre>
  
  <p>The field being sorted was Description and it has the following data type in the list
  Description  Single line of text.</p>
  
  <p>Any solutions to this problem.</p>
  
  <p>Thanks in advance.</p>