sum not working if field is 0

M

Meg

I have a query which sums fields in two tables.

The first table is checks and it sums checkswritten by
customer.
The second table is wires and it sums outgoingwires by
customer.
The query is Tranferedamount and the formula is
Transferededamount: [Sum Of checkswritten]+[Sum Of
outgoingwires].

It works fine when both checkswritten and outgoingwires
are not equal to 0, but if one if them is 0, then the
query doesn't seem to work.

Can someone point out what I am doing wrong?

Thanks so much,

Meg
 
G

Gerald Stanley

Try
Transferededamount: Nz([Sum Of checkswritten],0)+Nz([Sum Of
outgoingwires],0)

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I have a query which sums fields in two tables.

The first table is checks and it sums checkswritten by
customer.
The second table is wires and it sums outgoingwires by
customer.
The query is Tranferedamount and the formula is
Transferededamount: [Sum Of checkswritten]+[Sum Of
outgoingwires].

It works fine when both checkswritten and outgoingwires
are not equal to 0, but if one if them is 0, then the
query doesn't seem to work.

Can someone point out what I am doing wrong?

Thanks so much,

Meg
.
 
A

Allen Browne

It is probably the Null that is messing things up. Try:
Transferededamount: Nz([Sum Of checkswritten],0) + Nz([Sum Of
outgoingwires],0)

It may also be a good idea to convert the result back to Currency:
Transferededamount: CCur(Nz([Sum Of checkswritten],0) + Nz([Sum Of
outgoingwires],0))
 
M

Meg

Yes, that worked! Thanks!
-----Original Message-----
It is probably the Null that is messing things up. Try:
Transferededamount: Nz([Sum Of checkswritten],0) + Nz ([Sum Of
outgoingwires],0)

It may also be a good idea to convert the result back to Currency:
Transferededamount: CCur(Nz([Sum Of checkswritten],0) + Nz([Sum Of
outgoingwires],0))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

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

Meg said:
I have a query which sums fields in two tables.

The first table is checks and it sums checkswritten by
customer.
The second table is wires and it sums outgoingwires by
customer.
The query is Tranferedamount and the formula is
Transferededamount: [Sum Of checkswritten]+[Sum Of
outgoingwires].

It works fine when both checkswritten and outgoingwires
are not equal to 0, but if one if them is 0, then the
query doesn't seem to work.

Can someone point out what I am doing wrong?

Thanks so much,

Meg


.
 

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