I wrote this as a function because I think it's easier to read than inline code:
create function dbo.convert_amount_str ( @amount_str varchar(50) )
returns money
as
begin
declare @char_index int
declare @amount money
declare @char varchar(50)
declare @decimal money
-- Match the first non-numeric character
select @char_index = PATINDEX('%[^0-9]%', @amount_str)
-- Get the numeric characters into a numeric variable
select @amount = convert(money, SUBSTRING(@amount_str, 0, @char_index))
-- Get the non-numeric character (will work for multiple characters)
select @char = SUBSTRING(@amount_str, @char_index, (len(@amount_str) - @char_index) + 1)
-- Convert the non-numeric characters into decimal amounts
select @decimal = case @char
when 'A' then .8 -- whatever this should equate to
when 'H' then .7 -- whatever this should equate to
-- output for remaining characters
end
return @amount + @decimal
end
Then just use it like this:
select dbo.convert_amount_str('00484326A')
Or, more likely, referencing whatever column contains the numeric string values.