Displaying Zeros Instead of Null

brendandaly

Registered User.
Local time
Today, 17:52
Joined
Apr 29, 2011
Messages
36
I've got a query that populates a text box on my switchboard with a number of records incomplete. The problem is, when that count is zero, the whole switchboard comes up blank.In reading these forums ive figured out that the Nz([],0) function is what is going to solve this, however I cant figure it out. I've tried "CountofMaster_Key: Nz((Count([Master_Key])),0)" and "CountofMaster_Key: Count(Nz([Master_Key],0))" and a couple of other variations of those but just can not get that damn field to have a damn zero in it. Thanks in advance!
 
Look at the syntax

=Sum(Nz(Price, 0) * Nz(Quantity, 0))
 
I tried Count(Nz([Master_Key],0)) and it still didnt work. Am i missing something?
 
I can see that you created this thread in the Forms section, but the syntax you have is for Queries. Are talking about summing in a control on a form or in a query?
 
I'm populating a field on an form from a query. Would it be easier/work at all if I just made the control on the Form? The problem with that is there are some criteria that the count needs to fit like "complete" (which is controlled by a yes/no flag) and the type of records that are incomplete.
 
Perhaps you could upload a stripped down version of your db so we can see the scenario and provide a fix.
 
Id be happy to but I'm having a really hard time getting it to compress to less than 2MB thats SUCH a small size... In fact, I can't really get it to a smaller file at all. How do I do that? I've got the number of records in half and taken out a bunch of stuff that is working fine...
 
Did you remember to Compact & Repair?

Remove some records, remove the irrelevant objects (i.e. forms, reports etc), Compact & Repair
 
Got it. So the switch board that opens up when the DB is opened comes up blank because the person who finishes Auditing the NPI's is done meaning the 'TotalIncompleteNPI' query is returning null. In the 'CountofMaster_Key:...' field in that query is where the issue is.
 

Attachments

Did I boggle your mind with the idiocy of my database so much you haven't recovered from the shock yet?
 
I've consolidated your three queries into one and called it TotalIncomplete (following your naming convention). See attached.
 

Attachments

I don't even know what to say. That's incredible. I can't even express how thankful I am. I spent all day yesterday beating my head against a wall trying to figure this out and like, here it is, perfect. I never would have figured that out and was totally convinced a Nz() function was the solution. Thank you so so so much.
 
I don't even know what to say. This is incredible. I cant even express how grateful I am. It works like a charm. I spent all day yesterday banging my head against a wall trying to figure this out and I would never have come up with using an IIF statement. Freaking brilliant. Thank you so so so so much.
 
Hmm. My original thank you post didn't show up after I posted it so I reposted.Oops. Eh, for these beautiful queries I'll thank you twice.
 

Users who are viewing this thread

Back
Top Bottom