Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 165625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:57:15+00:00 2026-05-11T11:57:15+00:00

I am trying to calculate a SUM in an MS Access report the following

  • 0

I am trying to calculate a SUM in an MS Access report the following way:

  • Group1header – label

    • Group2header – value
      • Detail – example
      • Detail – example
    • Group2header – value
      • Detail – example
  • Group1footer [sum of Group2header value]

Somehow, when more detail rows appear, the sum in group1footer is incorrectly calculated (adds value for each detail).

I can not calculate the sums in the query, because the ‘value’ is already a calculated in the query (a subquery would return to many rows):

(     (         (sl_ticketdetail.weight,0) * sl_ticketdetail.amount          - (             SELECT SUM(sl_invoicedetail.amount)             FROM sl_invoicedetail              WHERE ticketdetailid = sl_ticketdetail.ticketdetailid         )         / 1000     )     * sl_ticketdetail.cost ) / 1000 

Any idea on what could be going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:57:15+00:00Added an answer on May 11, 2026 at 11:57 am

    Since you already have the Group2 sums pre-calculated in your query they will be repeated for each row of results and therefore cannot be used (as you found out) to calculate the Group 1 totals.

    You have two solutions

    1) pre-calculate the Group1 totals in your query as well and simply report them liek you do the Group2 totals

    2) use code in the Group2 footer format/print events to capture the value and manually increment a running Group1 total

    I would say 1) is the easiest – 2) is a little hairy and sometimes results in inaccurate totals if the users pages back and forth

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find the fastest way to calculate the sum of elements contained
I am trying to calculate a position to place label on the screen. The
I'm trying to create a query, that will calculate sum of products on invoice.
I'm trying to write this query, that would calculate the average value of all
So I am trying to calculate the average and sum of an array, however
I am trying to calculate an average value from a list of doubles I
I'm trying to calculate the sum of an array of decimal values in PHP,
My MySQL table has the following columns: datetime, price_paid. I'm trying to calculate the
I'm trying to create a conditional sum, in order to calculate an average. The
i am trying to calculate the sum of the first 16 elements of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.