Link to home
Start Free TrialLog in
Avatar of yadavdep
yadavdepFlag for India

asked on

Casting is giving error in sql server

I have a column in  my sql server table  JobCharge Decimal(18,2)
Now I am running this query
Select CAST(JobCharge as DECIMAL(18,15)) from Journal
And I am getting this error - Arithmetic overflow error converting numeric to data type numeric.

I checked the value the in the table and I found out this error is coming with values which has 4 digits before decimal place for example 3000.00
but it works fine with these values 30.00 or 300.00.

I don't know what wrong I am doing here.
ASKER CERTIFIED SOLUTION
Avatar of Nitin Sontakke
Nitin Sontakke
Flag of India 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
SOLUTION
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 yadavdep

ASKER

Thank you for your help. It clears out my understanding of Decimal fields