By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

Arithmetic overflow error converting nvarchar to data type numeric.

P: 1
I am trying to compare two fields which are char data typr.

BUT the comparision must be arithemetic in nature.

so i tried to cast both the data base field and my parameter field to big int types which failed.

I tried for Decimal type conversion and then comparision.

It gave me the above error.

Please help me..

the expression is something like

CAST(ENO AS decimal(18,0))>=CAST(@param1 AS decimal(18,0))
Aug 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: 39
2 things.
1) you must be 100% sure your data in fact CAN be converted to numeric (i.e. no characters)

2)you want to make sure your not trying to convert it to something smaller than it actually is.

Does your data have any decimal's in it? If so, then (18,0) isnt going to work. Try something really big at first like (30,15) and then scale it back as necessary.
Aug 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.