Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jul 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How To: Sum a column within a query (1.0)

    My question relates to being able to sum an entire column within a column. For example, after I run the query and it brings back the following results: 1,2,3 in a column heading of Sales, How can I add a row to sum this column? Your advice is appreciated.

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How To: Sum a column within a query (1.0)

    Hi wiinc1

    To add a calculated column to a query, See the attached:
    Where you see "PCredits:" (without the quotes), that will give you a field name.
    My example also handles a Null value.
    Attached Images Attached Images

  3. #3
    New Lounger
    Join Date
    Jul 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How To: Sum a column within a query (1.0)

    I apprecite the advice, but I get an error message saying subqueries cannot be used in that expression. Maybe I have done something wrong. Plus, I was not able to figure out what the last field you had in the post was.

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

    Re: How To: Sum a column within a query (1.0)

    You say that you want to add a row to sum a column. That is not the way queries work in a database, Access is not a spreadsheet program like Excel.

    However, you can do this easily in a report. If you build a report using the Report Wizard, it will offer to sum numeric fields. You can also add text boxes in the Report Footer section with control source like =Sum([ColumnName]), for example =Sum([Sales]).

Posting Permissions

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