title: text, ntext, and image data types cannot be compared or sorted
body: <p>SQL Server to show if field1 is null then field2, if field1 and field2 are null then field3, if field1, field2, field3 are null then field4 if all 4 fields are null then NULL  How would this be displayed in SQL Server?  I am assuming maybe a case statement and do case when etc but I am lost on this.</p>
  
  <p>EDIT --
  I tried running a straight COALESCE function like suggested and I get an error
  The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.</p>
  
  <pre><code>Select
  Count(SoldNum),
  Coalesce(Store1, Store2, Store3, Store4) As Store_Item_Sold_From
  ItemSoldBy
  ItemSold
  FROM salesDatabase
  Where Sold Is not null
  Group By ItemSoldBy, ItemSold, Coalesce(Store1, Store2, Store3, Store4)
  </code></pre>