View Full Version : Sum


aftershokk
01-17-2002, 12:49 PM
I have a query the calculates a margin from fields from another table (about 35,000 records).

I then perform a second query to sum the total of the margins.

I get OVERFLOW from Access and it does not work??

help and thanks!

Pat Hartman
01-17-2002, 02:21 PM
The magnitude of the answer exceeds the capacity of the data type. If the data type is Single, change it to Double. If it is Integer, change it to Long Integer.

aftershokk
01-18-2002, 11:56 AM
I perform the sum query on another query and changing properties/format does not stop the overflow.

help

aftershokk
01-18-2002, 12:18 PM
nothing works?

jadeIT
10-11-2002, 12:16 AM
I am getting the overflow error on the following calc in a query:

On the clients request, I am to add this calculation to a report. In the query it looks like this

x: ([sumofqty]*[cost]) / ([sumofreceived]*[cost])

As the value [sumofreceived] was sometimes zero, I got the division by zero error.

So I changed it to this IIF statement:

x: IIf([sumofreceived]=0,"",([sumofqty]*[cost])/([sumofreceived]*[cost]))

However, now I get the overflow error.

ALL the related fields in tables are of type Double. I also tried using the 'cdbl(...)' function but then I get a 'Invalid use of Null' error.

Rich
10-11-2002, 12:23 AM
Why not do the calculations on the Report? Which is probably the best place to do them anyway