How to Find Greater Than of an Alphanumeric Number


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for professional and amateur woodworkers

declare @tbl as table(SalesOrderNo varchar(10));
insert into @tbl values
('D 20'),
('D 21');

select SalesOrderNo from @tbl
where SalesOrderNo LIKE 'D%'
and cast(right(SalesOrderNo, len(SalesOrderNo) - 1) as int) > 16;

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results