Access 2002 Overflow error

J

Jon Gustafson

I am getting an overflow error when I try to sort on a
calulated field in a query. It is a very simple query in
which I add two fields together and divide by a thrid
field to get a resulting percentage. I receive an
overflow error whenever I apply sort criteria or a where
clause. If anyone has seen this and has an idea of what
might be the cause, I would appreciate some assistance.

BTW I am running windows 2000 professional and just
upgraded my MS office to Office XP.

Thanks,
Jon
 
A

Allen Browne

The overflow error indicates that a value has gone out of the expected
range. You can work around that by explicitly converting to a data type that
is big enough.

Given that you want a fractional answer (percentage), the Double type is
probably best. Try something like this:
MyResult: (CDbl([Field1]) + [Field2]) / [Field3]

Note that this expression will fail if Field1 is null, or if Field3 is zero.
 
J

Jon Gustafson

Thanks Allen,
I ended up moving the data to sql server and got a better
error. Simple data problem. My data was causing a divide
by zero error or 'Overflow' in Access terms. Anyway, put
where <> 0 in the where clause and problem resolved.
Thanks for the help.

Jon
-----Original Message-----
The overflow error indicates that a value has gone out of the expected
range. You can work around that by explicitly converting to a data type that
is big enough.

Given that you want a fractional answer (percentage), the Double type is
probably best. Try something like this:
MyResult: (CDbl([Field1]) + [Field2]) / [Field3]

Note that this expression will fail if Field1 is null, or if Field3 is zero.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jon Gustafson said:
I am getting an overflow error when I try to sort on a
calulated field in a query. It is a very simple query in
which I add two fields together and divide by a thrid
field to get a resulting percentage. I receive an
overflow error whenever I apply sort criteria or a where
clause. If anyone has seen this and has an idea of what
might be the cause, I would appreciate some assistance.

BTW I am running windows 2000 professional and just
upgraded my MS office to Office XP.

Thanks,
Jon


.
 

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