text, ntext and image data types cannot be compared

G

Guest

Posted this in the sql datamining group but no response. Hoping someone can
help. I'm trying to sort out a sql statement used to datamine thru excel.
The problem is it won't retrieve a text field.

Beginner user to data mining and creating SQL statements. I'm designing my
SQL statements through excel to create dashboards for staff. I want to
display a text field (it's a comment section in the app.) but I get the error
"the text, ntext and image data types cannot be compared or sorted, except
when using IS NULL or LIKE operator"

I tried adding a HAVING statement for IS NULL OR IS LIKE '%' but I get the
same error. Can someone help me out? I presume to get it to do a wild card
search of that field?
 
J

Jamie Collins

Ian said:
I get the error
"the text, ntext and image data types cannot be compared or sorted, except
when using IS NULL or LIKE operator"

Try casting the values to another type (e.g. VARCHAR).

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top