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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If not null, sum a field? 2

Status
Not open for further replies.

DownEaster

IS-IT--Management
Jun 22, 2005
2
US
In a report, I need to sum the contents of a field [$AMT] if another field
Code:
= is not null.  I have tried the following expression in the control source of the field I want to sum, but am getting a message "This control has a reference to itself"
=Sum(IIf(IsNull([Code]),0,[$ AMT]))
Any suggestions would be appreciated!
 
If this formula is going to work surely it should be in control that should hold the total.
 
How about

=Sum(Nz(
Code:
,0,[$ AMT])), in the total control


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - [URL unfurl="true"]www.kenneth.reay.btinternet.co.uk[/URL]
UK
 
Thanks - just tried the code in a new control for the total and it worked fine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top