i have a where clause which is throwing me error conversion failed when converting the vachar value "KL" to data type int select * from student st where ISNULL(st.rollno, '') NOT IN (2001,2003) wht could be the alternavite stmt?
This happens not because the **isnull** fails but rather because **NOT IN** does. You instruct the st.rollno value to be equal to empty string if such value is null. This part works fine. The problem is that the datatype of your column is varchar but you try to compare it to numeric values, such as 2001 and 2003. For you query to work, you will need to wrap those numbers into the single quotes: select * from student st where ISNULL(st.rollno, '') NOT IN ('2001', '2003'); Oleg