Last post Mar 20, 2012 05:25 PM by limno
Mar 20, 2012 04:32 PM|ak666|LINK
I get this error:
"Data types text and nvarchar are incompatible in the equal to operator"
Based on this Select query
SELECT ID, SCT, CMP, ACTIONS, REQUSTOR, REASON, CHANGED, CHANGEDBY, OTHER
WHERE (SCT = @SCT)
I understand its the = causing the problem but how do I find another way of doing this?
Mar 20, 2012 04:36 PM|Careed|LINK
The parameter value as defined in code needs to use the same SQL data type as the field it is associated with in the query.
Mar 20, 2012 04:45 PM|ak666|LINK
Thank you for coming back to me.
[SCT] = @SCT should be the same as [SCT] is a dropdown populated by the same dataset.
Mar 20, 2012 04:51 PM|ak666|LINK
Sorry just clicked what you said! I picked it up as data type :S
Changed from "=" to "like" and it works.
Mar 20, 2012 05:25 PM|limno|LINK
If you are using text data typy for SCT column, try to modify it to nvarchar(max) and test your query again.