DCount and NZ

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
 
K

Klatuu

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.
 
M

Marshall Barton

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.
 
J

Jörg Ackermann

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
 
D

DS

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
 
D

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
 
D

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 won't work? 1
DCount In Otherdb 6
Type Mismatch 1
DCount 2 Criteria 2
Missing Operator 3
DCount Syntax 2
No Records Then 4
DSum Problem 4

Top