The text,ntext and image data type cannot be compared or sorted except when IS NULL or LIKE
-
here is my query and i use it for making a crystal report when i run it in database MS Access it show the values but same query when i run it in sql server it show error "The text,ntext and image data type cannot be compared or sorted except when IS NULL or LIKE" there are its datatypes TotalSale int Price money Category Text Transaction Text same datatype used in sqlserver and MS access. Plz help
SELECT Sum(b.TotalSale*b.Price) AS total, a.Category , a.[Transaction]
FROM TransactionType AS a INNER JOIN CouponTransaction AS b ON a.TransactionTypeID = b.TransactionTypeID
GROUP BY a.Category,a.[Transaction]; -
here is my query and i use it for making a crystal report when i run it in database MS Access it show the values but same query when i run it in sql server it show error "The text,ntext and image data type cannot be compared or sorted except when IS NULL or LIKE" there are its datatypes TotalSale int Price money Category Text Transaction Text same datatype used in sqlserver and MS access. Plz help
SELECT Sum(b.TotalSale*b.Price) AS total, a.Category , a.[Transaction]
FROM TransactionType AS a INNER JOIN CouponTransaction AS b ON a.TransactionTypeID = b.TransactionTypeID
GROUP BY a.Category,a.[Transaction];You can't GROUP BY a field of type
text
. You could cast Category to avarchar
, but that would not perform well. Are you sure that the typetext
is the most appropriate for your data? Avarchar
might be much better and your GROUP BY would then work. -
You can't GROUP BY a field of type
text
. You could cast Category to avarchar
, but that would not perform well. Are you sure that the typetext
is the most appropriate for your data? Avarchar
might be much better and your GROUP BY would then work.thnx Nigel now its working when i change its datatype. again thank u very much