---
title: "The text, ntext, and image data types cannot be compared or sorted??"
type: "forum-thread"
url: "https://www.webforum.nu/amne/databaser-sql/138579-the-text-ntext-and-image-data-types-cannot-be-compared-or-sorted"
topic: "Databaser & SQL"
topic_url: "https://www.webforum.nu/amne/databaser-sql"
author: "jimpa"
published: "2005-12-01T15:58:32.000Z"
updated: "2005-12-01T16:05:21.000Z"
replies: 1
views: 225
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/databaser-sql/138579-the-text-ntext-and-image-data-types-cannot-be-compared-or-sorted"
---

# The text, ntext, and image data types cannot be compared or sorted??

## #1 — jimpa, 2005-12-01T15:58Z

Hej,

Jag har en sql databas och en sql-sats som ser ut så här:

```
	   strSQL = "SELECT Topics.TopicID, Topics.tTitle, Topics.tDate, Topics.tActive, Topics.tDescription, "
	   strSQL = strSQl & "(select count(*) FROM Faqs where Faqs.fTopicID = Topics.TopicID) as CountFaqs "
	   strSQL = strSQl & "FROM Topics "
	   strSQL = strSQL & "GROUP BY Topics.TopicID, Topics.tTitle, Topics.tDate, Topics.tActive, Topics.tDescription 
	   strSQL = strSQL & "ORDER BY 2 DESC"
```

Men får detta felmeddelande:
*Microsoft OLE DB Provider for SQL Server error '80040e14' 

The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. 

/admin/topics.sp, line 37*  

Vad gör jag fel?

Mvh,
Jimmy

Permalänk: https://www.webforum.nu/p/138579

## #2 — LarsG, 2005-12-01T16:05Z

Varför använder du text/nText för en titelkolumn?

Permalänk: https://www.webforum.nu/p/1720426

---

Tråden på webben: https://www.webforum.nu/amne/databaser-sql/138579-the-text-ntext-and-image-data-types-cannot-be-compared-or-sorted
