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
 
Back
Top