pratikshahse
asked on
Cast currency to a decimal in SQL server
i want to convert a currency field in a SQL server query to a decimal field
Select ISNULL( mrm_amt,0) AS OriginalMRMAmt from contract_rate.
In this query mrm_amt is a currency field and I want to cast it to a decimal. How do I do that?
Select ISNULL( mrm_amt,0) AS OriginalMRMAmt from contract_rate.
In this query mrm_amt is a currency field and I want to cast it to a decimal. How do I do that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you want to use CONVERT function
SELECT ISNULL(CONVERT(DECIMAL, mrm_amt), 0) AS OriginalMRMAmt FROM contract_rate
SELECT ISNULL(CONVERT(DECIMAL, mrm_amt), 0) AS OriginalMRMAmt FROM contract_rate
CAST( "variable" AS decimal )
If not use the CONVERT function in SQL.