Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Dec 2007
    Location
    Sacramento, California, USA
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adding items in a table (2003)

    I have a table with 4 columns. I want column #5 to be a total of the numbers in the first 4 columns. Is this done in a query or directly in the table?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: adding items in a table (2003)

    Since the total is a calculated value, you do this in a query. This avoids unnecessary storage of data and ensures that the total is up-to-date when you need it.

    Create a query based on the table, and add the four fields. To the right of them, create a calculated column:
    <code>
    Total: Nz([Field1],0)+Nz([Field2],0)+Nz([Field3],0)+Nz([Field4],0)
    </code>
    where Field1 ... Field4 are the names of the fields from the table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •