Adding a null value in access table

Posted on 2014-07-16
Last Modified: 2014-07-19
I have two columns in Access. I would like to sum fields from these two columns into a new column but I have some NULL values in some of the fields.

How can I do this?

Question by:vpopper
    LVL 21

    Expert Comment

    by:Randy Poole
    for those colums use the isnull with IIF as

    Open in new window

    LVL 84
    Or just use Nz. If you're doing this in a query, for example:

    SELECT Col1, Col2, Nz(Col1,0) + Nz(Col2, 0) AS SumOfCols

    Author Comment

    Total - All Credits: =NZ[Supplier Credit] + NZ[SS Credit]

    This is my ACCESS Query - using NZ but this is not working???

    LVL 47

    Expert Comment

    by:Dale Fye (Access MVP)
    The NZ( ) function must have opening and closing ()

    Total - All Credits: NZ([Supplier Credit], 0) + NZ([SS Credit], 0)

    BTW,  it is a bit confusing that you are labeling this column as "Total - All Credits" and are doing a sum in the calculation.
    LVL 84

    Accepted Solution

    You must enclose Nz with parentheses:

    Total - All Credits: =NZ([Supplier Credit],0) + NZ([SS Credit],0)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    759 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

    9 Experts available now in Live!

    Get 1:1 Help Now