adding numbers with a null value in access

Posted on 2009-04-21
Last Modified: 2012-05-06
i am trying to add to columns some with a null value.
A      B
34      6
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
Question by:dina78
    LVL 3

    Expert Comment

    Use something like

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

    see for details (works also for Access 2003)
    LVL 39

    Accepted Solution

    try nz(filedname)

    Like this

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

    LVL 39

    Expert Comment

    by:Pratima Pharande
    sorry sreindl0 , I havn't refresh the page
    and no need to gove extra paramete in NZ
    LVL 3

    Expert Comment

    indeed, but that looks more intuitive :-)

    Author Closing Comment

    works thank you:)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now