469,946 Members | 1,784 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Arithmetic overflow error converting nvarchar to data type numeric.

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
1 17152
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.

Similar topics

2 posts views Thread by shank | last post: by
2 posts views Thread by Robert McEuen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.