Converting varchar to sql

Hi,

I need to select a varchar field as numeric.

eg: (select amt from tb1) union (select amt from tb2)

amt in tb1 is a numeric field
amt in tb2 is a varchar field.

but amt in tb2 has values like $100.00 , $10.45 and so on.

I would like to know if there is any way to discard the '$' symbol and collect the rest of the data. cast(amt as numeric) didnt work as it has '$' symbol.

I am a novice programmer and any help would be appreciated. I am working on MSSQL.

Thanks
[555 byte] By [wildkat] at [2007-11-19 19:54:15]
# 1 Re: Converting varchar to sql
Dont bother. I got the solution.

(select amt from tb1) union (select CAST(substring(AMT,2,10) as numeric) FROM tb2)
wildkat at 2007-11-9 13:43:28 >
# 2 Re: Converting varchar to sql
Are you sure that all the values in that column are, without any exceptions, cast-able to numeric?
exterminator at 2007-11-9 13:44:28 >