Link to home
Start Free TrialLog in
Avatar of pratikshahse
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?
ASKER CERTIFIED SOLUTION
Avatar of k_rasuri
k_rasuri

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
Avatar of the_mickster
the_mickster

This should do the trick.

CAST(    "variable"  AS   decimal    )

If not use the CONVERT function in SQL.
if you want to use CONVERT function

SELECT ISNULL(CONVERT(DECIMAL, mrm_amt), 0) AS OriginalMRMAmt FROM contract_rate