Numeric Field Overflow error

V

Vina

Hello, can someone tell me why i am getting this.
Sometimes my query runs ok and then sometimes it wont i
cannot see anything that it causing it. It should not be
something with the query cause sometime it runs
successful and sometimes it gives me this error. Has
anyone seen this or know what the solution? this is
running Access 97

Thanks
 
A

Allen Browne

An overflow can occur easily.

Open the Immediate Window (Ctrl+G), and enter:
? 200 * 200
This gives an overflow, because Access treats the 200s as integers, and 200
times 200 is too large for an integer (max 32767).

To solve the problem, convert one of the numbers into a long:
? CLng(200) * 200

Hopefully you can do something along those lines in your query.
 
M

[MVP] S.Clark

An integer can hold numbers up to 32,768. If any of your data is greater
than that, then you will get an overflow error. The fix is to use a long
integer instead.

Byte < Integer < Long Integer
Single < Double

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top