DCount and NZ

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I tried both of these expressions to get a 0 when there are no
records...neither works. Any suggestions?

=NZ(DCount([SalesID],"UnPaidChxQ"),0)
Text10=NZ(DCount([SalesID],"UnPaidChxQ"),0)

Thanks
DS
 
I'm not sure what you are trying to do. They way your code is structured,
the only time you will get 0 is when there are no records in the table at
all. You don't have criteria defined.
 
DS said:
I tried both of these expressions to get a 0 when there are no
records...neither works. Any suggestions?

=NZ(DCount([SalesID],"UnPaidChxQ"),0)
Text10=NZ(DCount([SalesID],"UnPaidChxQ"),0)


There must be something else going on. I always get a zero
when there are no records. Whatever it is, I can't see it
in your posted expression.

Note that the Nz is unnecessary with DCount.
 
Hi,

DS schreibselte:
I tried both of these expressions to get a 0 when there are no
records...neither works. Any suggestions?

=NZ(DCount([SalesID],"UnPaidChxQ"),0)
Text10=NZ(DCount([SalesID],"UnPaidChxQ"),0)

Thanks
DS

Try:

=DCount("*","UnPaidChxQ")

or

DCount("SalesID","UnPaidChxQ")


Acki
 
Klatuu said:
I'm not sure what you are trying to do. They way your code is structured,
the only time you will get 0 is when there are no records in the table at
all. You don't have criteria defined.

:

I tried both of these expressions to get a 0 when there are no
records...neither works. Any suggestions?

=NZ(DCount([SalesID],"UnPaidChxQ"),0)
Text10=NZ(DCount([SalesID],"UnPaidChxQ"),0)

Thanks
DS
Thats it, Whenever I don't hae any records I want a Zero.
Thanx
DS
 
Marshall said:
DS said:
I tried both of these expressions to get a 0 when there are no
records...neither works. Any suggestions?

=NZ(DCount([SalesID],"UnPaidChxQ"),0)
Text10=NZ(DCount([SalesID],"UnPaidChxQ"),0)



There must be something else going on. I always get a zero
when there are no records. Whatever it is, I can't see it
in your posted expression.

Note that the Nz is unnecessary with DCount.
Thanks, I changed my Query around and that worked. It was an incorrect
join.
Once again everyone, Thank You!
DS
 
Jörg Ackermann said:
Hi,
DS schreibselte:
I tried both of these expressions to get a 0 when there are no
records...neither works. Any suggestions?

=NZ(DCount([SalesID],"UnPaidChxQ"),0)
Text10=NZ(DCount([SalesID],"UnPaidChxQ"),0)

Thanks
DS


Try:

=DCount("*","UnPaidChxQ")

or

DCount("SalesID","UnPaidChxQ")


Acki
Thanks, see previous post.
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DCount 2 Criteria 2
No Records Then 4
A Better Way 4
DSUM Not Working 5
DMax Acting Up 6
DCount In Otherdb 27
Type Mismatch 1
Access Dcount function in access 0

Back
Top