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!

I need the Count() Function to return Zero Values

Status
Not open for further replies.

ewong1

Technical User
Apr 25, 2005
1
US
I am a new user in Access, so please pardon my lack of knowledge. I am having trouble with my totals queries and their ability to show a zero value.

-I am trying to query up totals for a my table: [tblCS_CT].
-I have two queries set up: [qryCS_CTMiss] & [qryCS_CTTotal].
-These two queries are linked to [qryCS_CTQueryDate] which prompts the user to enter a beginning and ending date.
-[qryCS_CTMissVTotal] combines [qryCS_CTMiss] & [qryCS_CTTotal] showing the total number of misses vs the total number of records for the date period entered by the user.

The problem I am having is that [qryCS_CTMissVTotal] will return data if there is a miss involved, but not if there is null data in the "miss" category.

EX: 1 Miss with 14 Total records will show because there is one recorded miss within the prompted date range. However, 0 Misses with 3 Total records does not return anything. Is there a way for me to query up a 0 miss 3 total records view?
 
Take a look at the nz() function.

Essentially, it will translate a null value to a useable number/string.

So, if you want it to be zero, have it say something like:
nz([TheFieldNameForMisses], 0)

Hope this helps!

-------------------------
Just call me Captain Awesome.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top