Steve A
asked on
Search for a decimal and then remove it from string
Hello,
I need a T-SQL Statement to search a string variable for a decimal and
then remove it.
@string = '1234.5'
I want @string to equal '12345'
If I do it this way:
Set @string = replace(@string, '.', '')
I would assume it would remove the decimal in the string.
What if @string = '12345', with no decimal?
Would it not work and set @string = NULL, due to not finding a decimal within the
replace statement?
Thanks.
I need a T-SQL Statement to search a string variable for a decimal and
then remove it.
@string = '1234.5'
I want @string to equal '12345'
If I do it this way:
Set @string = replace(@string, '.', '')
I would assume it would remove the decimal in the string.
What if @string = '12345', with no decimal?
Would it not work and set @string = NULL, due to not finding a decimal within the
replace statement?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER