Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum() a complex # in a Report???

Status
Not open for further replies.

alwayslearning

Technical User
Joined
Nov 8, 2000
Messages
7
Location
CA
Accum Depn: ([Purchase Price]/[Depn Period])*([# Months])
is a formula in my Query.

The Query works fine... the Report doesn't Sum()...

I have tried...
=(Sum([Accumulated Depreciation Query]![Purchase Price])/
Sum([Accumulated Depreciation Query]![Depn Period])+1)*
Sum(IIf(DateDiff("m",[Asset Database]![Date],[Date Query Ranges]![As At Date])>=[Depn Period],[Depn Period],DateDiff("m",[Asset Database]![Date],[Date Query Ranges]![As At Date])+1))

Summing each of the components of the equation gives an incorrect answer
and
Sum(([Purchase Price]/[Depn Period])*([# Months]))
is too complex for the Report to compile!!!

Any and all suggestions are highly appreciated!!!
 
It turns out part of the database was unsuccessfully trying to divide a column by zero in the Query.

When I deleted all zeros in the database Table and left the fields blank all formulae in the Report worked perfectly!!
 
Look at the nz function in help. It makes long equations a little tedious to type however you can asign a value to blank fields ie "0" if your trying to add or 1 if you which to divide or mulitple.

nz([field],1)+nz([field2,0)

hth
 
Tks for the tip!
I did try the Nz function at one point...
will try it again.

Tks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top