Solved

DSum syntax in a subreport

Posted on 2004-09-23
5
353 Views
Last Modified: 2010-05-18
Hi,

I'm having a major problem trying to get this to work.

I have a subreport that calculates within the detail of a subreport like this:

[Volume]  |  [IOProductName]   |  [Rate]   |  [Text41]
---------------------------------------------------------------
500               Whatever Text           30             15,000
200               Whatever Text           40               8,000
---------------------------------------------------------------

In the report footerI need the sum of [Text41]. I have tried simply writing Sum([Text41]) and the 'Enter parameter Value' promt comes up looking for value of [Text41].

How do I do this?

Cheers,

LoveToSpod


0
Comment
Question by:LoveToSpod
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:pique_tech
ID: 12134189
Is Text41 already a calculated control, say [Volume]*[Rate]?

If it is, then you cannot aggregate over it.  Instead, you must have Sum([Volume]*[Rate]).

Hope this helps.
0
 

Author Comment

by:LoveToSpod
ID: 12134263
The problem is if you have sum of volumes * rates then you do not get the individual calculations!! E.g

[Volume]  [rate]  [Answer]
      5           4          20
      6           8          48

Correct TOTAL  =     68
Simple ([Volume]*[Rate]) = 132

Is there a more simple way of doing this?

I need the answer real soon, so I'm upping the points...
0
 
LVL 12

Accepted Solution

by:
pique_tech earned 500 total points
ID: 12134471
I'm not sure you did what I suggested.  Not to duplicate what you'd done before, exactly, but to sum it:

SUM([Volume]*[Rate])

This works for me in a report footer.  Unless I've completely misunderstood your question...

I have the following data:
v     r     a (calculated [v]*[r])
2    15    30
3    15    45
4    15    60
the field in the footer is sum([v]*[r]) and it returns the expected answer 135

0
 
LVL 3

Expert Comment

by:gemost
ID: 12134499
Create another text box in the details section of the subreport. Then as its control source put = sum(text41). you can make the text box invisible and then reference it in the  footer. You may even be able to copy it into the footer before you make it invisble in the detail section.

HTH
gemost
0
 

Author Comment

by:LoveToSpod
ID: 12134581
You hero,

Cheers for re-iterating it... For some reason I need to divide the answer by 1000 to get the correct number!!! Dunno why, maybe something I haven't spotted yet. Brilliant.

Sorry gemost, I tried that, and it still prompts for the value of [Text41]... Dunno why Grrrr...

Thanks folks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

773 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