|
 |
access thread: DSum function
Message #1 by "Lowe, Wanda L" <wlowe@u...> on Fri, 28 Feb 2003 15:43:15 -0600
|
|
Hello!
I am trying to calculate a sum using the DSum function in the control source
of a textbox in a report.
Here is one of the bazillion tries I have made (in the control source
property):
=DSum("[SumOfHours]","qrySummaryJoin","[ServiceCategory]= 'SPCE' ")
"qrySummaryJoin" is a select query that is the record source for the report,
SumOfHours is a numeric field, and ServiceCategory is another field in the
recordset that results from the query. I want to display the sum of the
values in the SumOfHours fields in only those records that have "SPCE" in
the ServiceCategory field.
Can anyone tell me how I can make it work?
Thanks,
Wanda
Message #2 by Lonnie Johnson <prodevmg@y...> on Fri, 28 Feb 2003 14:09:27 -0800 (PST)
|
|
You could create an invisible text box on your report in the detail section. Set the running sum property to OverAll. Call it
txtRunSum. For the control source put...
=IIf([ServiceCategory]= "SPCE",[SumOfHours],0)
This will create a running sum for your field. In the footer of the report and add another text box and set it's control soure =
txtRunSum.
Just a thought...
"Lowe, Wanda L" <wlowe@u...> wrote:Hello!
I am trying to calculate a sum using the DSum function in the control source
of a textbox in a report.
Here is one of the bazillion tries I have made (in the control source
property):
=DSum("[SumOfHours]","qrySummaryJoin","[ServiceCategory]= 'SPCE' ")
"qrySummaryJoin" is a select query that is the record source for the report,
SumOfHours is a numeric field, and ServiceCategory is another field in the
recordset that results from the query. I want to display the sum of the
values in the SumOfHours fields in only those records that have "SPCE" in
the ServiceCategory field.
Can anyone tell me how I can make it work?
Thanks,
Wanda
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
http://www.prodev.us
Let me build your next MS Access database application.
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more
|
|
 |