The following is similar to a query I have that needs to cast a field to a type and evaluate it, and I want to ignore rows that have data that cannot be cast to the target data type.
select * from MyTable
where case when isnumeric(SomeField) = 1 then SomeField else null end > 1
So in the above example I am able to test for values greater than one while avoiding the conversion error that would be caused if there were any non-numeric fields in the SomeField. I'm okay with this solution, but I'm just wondering if there's a better way to do it?