Report Null and Nz problem

G

Guest

I have a report called Statement, I am using this expression to calculate and
display all payments made to each order:

=IIf(IsNull([OrderID]),0,DSum("[PaymentAmount]","[Payments]","[OrderID]=" &
[Reports]![Statement]![OrderID]))

I need it to also display $0.00 when there has been no payments made. How
wo I use the Nz function in the expression above? Also when I try to create
a Total Due on the report footer, it doesnot work. Is it because of the Null
problem in the expression above. I Think if I can get the Null problem
solved, everything else will work, I hope.
 
M

Marshall Barton

minimom said:
I have a report called Statement, I am using this expression to calculate and
display all payments made to each order:

=IIf(IsNull([OrderID]),0,DSum("[PaymentAmount]","[Payments]","[OrderID]=" &
[Reports]![Statement]![OrderID]))

I need it to also display $0.00 when there has been no payments made. How
wo I use the Nz function in the expression above? Also when I try to create
a Total Due on the report footer, it doesnot work. Is it because of the Null
problem in the expression above. I Think if I can get the Null problem
solved, everything else will work, I hope.


In this case, you could use it in front of any of the other
function calls ;-)

Here's the way I would do it:

=IIf(IsNull(OrderID),0,Nz(DSum("PaymentAmount","Payments","OrderID="
& OrderID), 0))
 
G

Guest

THANKS, looks like my problem was where I was putting "0" in the expression.
You have given me back my sanity, now all I have to do is get the Total Due
for the statement to work. Thanks again

Marshall Barton said:
minimom said:
I have a report called Statement, I am using this expression to calculate and
display all payments made to each order:

=IIf(IsNull([OrderID]),0,DSum("[PaymentAmount]","[Payments]","[OrderID]=" &
[Reports]![Statement]![OrderID]))

I need it to also display $0.00 when there has been no payments made. How
wo I use the Nz function in the expression above? Also when I try to create
a Total Due on the report footer, it doesnot work. Is it because of the Null
problem in the expression above. I Think if I can get the Null problem
solved, everything else will work, I hope.


In this case, you could use it in front of any of the other
function calls ;-)

Here's the way I would do it:

=IIf(IsNull(OrderID),0,Nz(DSum("PaymentAmount","Payments","OrderID="
& OrderID), 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