Calculation in Report (1 Viewer)

gcormier

Registered User.
Local time
Today, 07:58
Joined
May 31, 2000
Messages
13
I am trying to calculate =sum([field1]/[field2]) in a report. I am getting an overflow error and a div by zero error. How can I handle this to make it work? Thanks. -GAC
 

chrismcbride

Registered User.
Local time
Today, 07:58
Joined
Sep 7, 2000
Messages
301
First off, do yourself a favour and never use division in a Form or Report without trapping for zero. I use IIF because it makes the most structural sense to me. You go...
SUM([Field1] / IIF([Field2]>0, [Field2],1))

As far as the overflow goes I know only that you have somehow specified a calculation that is too complicated. Is it possible that either of the fields that you use are caluculated themselves? Are both fields proper data types?
Hope this helps
Chris
 

Users who are viewing this thread

Top Bottom