Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

Currency in SQL?

My output for ExternalFeeOrCreditAmount is: "1.03 USD varchar(255)"

I am trying to change my output to just "1.03" so I can perform arithmetic on a numerical value and not a varchar.
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

In MySQL, you may try:
set @ExternalFeeOrCreditAmount = '1.03 USD varchar(255)';

select SUBSTRING_INDEX( @ExternalFeeOrCreditAmount, ' ', 1 ) as ExternalFeeOrCreditAmount;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore 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