zeros

M

mtress

I want blank records to return a zero in either a report
or the crosstab query the reports based on. Is there a
simple way to do this?
 
A

Allen Browne

Use Nz() to supply a value to use for Null.

Open your crosstab query in SQL View.

You will see something like:
Sum([Amount]) AS SumOfAmount

Change it to:
Nz(Sum([Amount]),0) AS SumOfAmount

Better still:
CCur(Nz(Sum([Amount]),0)) AS SumOfAmount
 
M

mtress

-----Original Message-----
I want blank records to return a zero in either a report
or the crosstab query the reports based on. Is there a
simple way to do this?
.
Never mind. Figured it out. Seems as if you can't
build an Nz Function in a crosstab query. Or at last not
in the value field of a crosstab. So I did a select
query based on crosstab and was then able to build my
expression from there.
 
M

mtress

-----Original Message-----
Use Nz() to supply a value to use for Null.

Open your crosstab query in SQL View.

You will see something like:
Sum([Amount]) AS SumOfAmount

Change it to:
Nz(Sum([Amount]),0) AS SumOfAmount

Better still:
CCur(Nz(Sum([Amount]),0)) AS SumOfAmount
Thank you very much.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I want blank records to return a zero in either a report
or the crosstab query the reports based on. Is there a
simple way to do this?


.
 

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