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

Have Count() Return Zero

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
In my query I am caluculating Age, then using Count() to get the number of people between a certain age range. If there are not people between the age range it does not return anything. Fine, however I attached the query to a report and on the report it shows up as an #error. Can I get it to display as a Zero? Help Please. I am a new at this.
 
In your report in the object (ex. textbox) try something like:
=iif(Count() is null,0,Count())
Some variation on this idea should solve your problem.
 
In your report in the object (ex. textbox) try something like:
=iif(Count() is null,0,Count())
Some variation on this idea should solve your problem.
 
There is a function called NZ that will return a zero if there is not value. It may work for your situation..
EXAMPLE: =NZ([myfieldname]) Hope it helped
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top