Sunday, June 29, 2014

Conversion failed when converting the varchar value '5,6' to data type int.

When ever you get data from multivalued checkbox, atleast in SSRS it will come as a String '1,2,3,4,5,6'. You will have to split the string with a function and then you can run the query. Otherwise, the CAST will try to cast 1,2,3,4,5 as INT which is invalid



SELECT *
FROM Table
WHERE Condition IN(SELECT ParsedValues
FROM dbo.splitString(inputString))


No comments:

Post a Comment