I'm struggling to combine two expression into one so that I can remove trailing 'mm' chars of a varchar column which holds values like 3.214mm and use those chars as numeric values.
The problem I have is that there can be also null or empty string values and I can't find a way to combine both expressions below.
Example: SQLfiddle
DECLARE @string varchar(128)
SET @string = '4.123mm'
SELECT ISNULL(NULLIF(@string,''),NULL) As MyString ;
DECLARE @createNumber varchar(128)
SET @createNumber = '4.123mm'
select LEFT(@createNumber, NULLIF (LEN(@createNumber) - 2, - 1))As MyNumber