could any one plz help me for this query. i have tried a lot but only the first one is working. see my code:
(1)
CommandText = _ "SELECT sr.ResponseAnswerID, count(sr.RespondantID) from SURVEY_RESPONSE sr INNER JOIN ANSWER a on " _ & "sr.ResponseAnswerID=a.AnswerID where a.QuestionID= 284 " _ & "group by sr.ResponseAnswerID"
(2) CommandText = _ "SELECT a.AnswerDescription, count(sr.RespondantID) from SURVEY_RESPONSE sr INNER JOIN ANSWER a on " _ & "sr.ResponseAnswerID=a.AnswerID where a.QuestionID= 284 " _ & "group by a.AnswerDescription"
------ for the first one it is working fine but displaying only its id. what i want is AnswerDescription instead of ResponseAnswerID.
the error for (2) is The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
i have tried a lot, using select in another select statement, having into, like.... but none is working
hope to have a quick response. thanks
antish
Hello,
You have any field in either table which is having a data type of text or ntext or image. If you used text or ntext field, please change the datatype to varchar and then try the query again.
All the best
Pallab