Null

T

tom.michiels1

Hello,

I have a database with count query's.
Then i have a query that gives me a total of the count's
When one of the counts is null the total is also null.
I have tryed to put Nz before de sum, but it is the same.

Can somebody help me.
 
S

Sharkbyte

Tom:

Can/Are the querys done in code? If so, you can use an IIf statement. Such
as:

IIf Isnull(dcount("[ColumnName]", "[TableName]")), 0, dcount("[ColumnName]",
"[TableName]"))

If you were to read this statement it would say, "If counting this column
returns a null, change the null to 0, if it is not null then return the
count."

I believe there would be a way to use the IIf statement, in the query form
itself, but I'm not confident I know the proper syntax.

Sharkbyte
 
S

Sharkbyte

Tom:

If you do want to try and use the DCount function, check the help files to
see how to add criteria to the statement. My sample did not include any...

Sharkbyte
 
B

Bob Quintal

(e-mail address removed) wrote in @o61g2000hsh.googlegroups.com:
Hello,

I have a database with count query's.
Then i have a query that gives me a total of the count's
When one of the counts is null the total is also null.
I have tryed to put Nz before de sum, but it is the same.

Can somebody help me.

Instead of putting the nz() before the sum() put the sum() before
the nz()

sum(nz([whatever,0))
..
 

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

Top