webForumDet fria alternativet
Logga in / Bli medlem

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

Databaser & SQL

1 svar · 225 visningar · startad av jimpa

Medlem sedan jan. 2001361 inlägg
Trådstart#1

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

Medlem sedan dec. 200012 464 inlägg
#2

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

257 ms totalt · 4 externa anrop · v20260731065814-full.51f67c91
115 ms — deklarationer (db)
0 ms — hämta statistik (cache)
129 ms — hämta tråd, inlägg och bilagor (db)
125 ms — ändringar (db)