Try this:
SELECT *
FROM Customer
WHERE (case when ISNUMERIC(Notes) = 1 then cast(Notes as float) end) > 1200 AND
(case when ISNUMERIC(Notes) = 1 then cast(Notes as float) end) < 1300
This works because the case
guarantees the order of evaluation in this case. You could also write this with a subquery:
select *
from (select c.*,
(case when ISNUMERIC(Notes) = 1 then cast(Notes as float) end) as NotesNum
from Customer c
) c
where NotesNum > 1200 and NotesNum < 1300;
Alternatively, this might come close to what you want:
SELECT *
FROM Customer
WHERE ISNUMERIC(Notes) = 1 AND
Notes > '1200' AND Notes < '1300' and len(notes) = 4 and notes not like '%.%'