I am using MS SQL and have i think a simple question. I want to report all the values from a column that are not integer compliant values. The Try_Cast will attempt to convert all values to INT and for any value that it cannot it displays null. How can i just capture the nulls which are the failures?
select [ValueTest], TRY_CAST([ValueTest] AS int) as 'ConvertedValue' from [TestData]
ValueTest ConvertedValue --------- ---------------- 100 100 ABC -3 -3 23.99 How can i display only the nulls? For example, expected results: ValueTest ConvertedValue --------- ---------------- ABC 23.99
Open in new window