Link to home
Start Free TrialLog in
Avatar of Elucidate-Technologies
Elucidate-TechnologiesFlag for Puerto Rico

asked on

mysql varchar number to decimal

Hi, I have a mysql varchar field that contains formatted numbers.

I need a script to change that formatted varchar to decimal.

Example of what I have in `monthlysalary` varchar field:

1,500.00
3,000.00
2,600.00

Example of what I need as decimal:

1500.00
3000.00
2600.00

I need to be able to multiply the amount in the field by 0.15.

I have tried using cast(`monthlysalary` as decimal(10,2)) but it returns the following:

1,500.00 = 1.00
3,000.00 = 3.00
2,600.00 = 2.00


ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial