• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

adding numbers with a null value in access

i am trying to add to columns some with a null value.
A      B
34      
34      6
      5
when i do a simple sum function A+B and either A or B is has a null vaule the function does not return a result.  whats the function that can enable me to add a number with a null vaule
i can not use update query to insert zero because i am using a large number of records
Regards
0
dina78
Asked:
dina78
  • 2
  • 2
1 Solution
 
sreindl04Commented:
Use something like

SELECT Nz(A,0)+Nz(B,0) FROM tablename;

see http://office.microsoft.com/en-us/access/HA012288901033.aspx?pid=CH100728911033 for details (works also for Access 2003)
0
 
Pratima PharandeCommented:
try nz(filedname)

Like this

SELECT nz(a)+nz(b) AS Expr1
FROM Tablename;

refer

http://articles.techrepublic.com.com/5100-10878_11-6125114.html
0
 
Pratima PharandeCommented:
sorry sreindl0 , I havn't refresh the page
and no need to gove extra paramete in NZ
0
 
sreindl04Commented:
indeed, but that looks more intuitive :-)
0
 
dina78Author Commented:
works thank you:)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now