I have a table full of serial numbers of a product, the datatype is nvachar, i have entries like 1001, 1002, 1003, abc001, efg002, 1004, def222 . I have to return the max value
of the valid numeric numbers in the column, in this case output should be 1004.
This SQL Query is working
select top 1
cast(SerialNo as integer)
from [InvSerialItemDetails]
where isNumeric(SerialNo) = 1
Order by cast(SerialNo as integer) desc
I have to do the same in LINQ
. But there is no isNumeric function in LINQ. How to get the same output in LINQ
in VB language