query returns no records, need to convert to "0"

  • Thread starter Thread starter bman33
  • Start date Start date
B

bman33

my query returns no records, but i need it to be a zero value because that
answer is used in a report that totals several items. Without a number (0),
the totals won't work.
 
If the report is based on a query that returns no records, and you have a
text box in the report footer that is bound to an expression like this:
=Sum([Amount])
it displays #Error.

If you want to show a zero instead, change the expression to:
=IIf([Report].[HasData], Sum([Amount]), 0)

More information:
Avoid #Error in form/report with no records
at:
http://allenbrowne.com/RecordCountError.html
 
Back
Top