Solved

DSum syntax in a subreport

Posted on 2004-09-23
5
328 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

707 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

18 Experts available now in Live!

Get 1:1 Help Now