Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to remove single Quote from given select Query. It is give me Converstion failed when converting the varchar value '1,2,3' to data type int.


SQL
SELECT * FROM Member
WHERe MemberId IN ('1,2,3')
Posted
Comments
CHill60 5-Mar-15 9:02am    
Sure this is just as simple as SELECT * FROM Member WHERE MemberId IN (1,2,3) - why did you put the single quotes in???
DipakTalaviya 7-Mar-15 5:39am    
B'cause the values in "IN" Clause in my case it's in string. so, i get the conversion error.
I found the solution that if my query is in single quote then I can pass value in "IN " Clause with string like '1,2,3'. That's it.

1 solution

Solved here,
data type converting issue[^]

I was asked the same question a year ago ;)
 
Share this answer
 
Comments
DipakTalaviya 5-Mar-15 8:10am    
Thanks, By this way I can solved my problem.
King Fisher 5-Mar-15 8:12am    
Welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900