473,480 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Report total only calculating for the last group.

Mj~
4 New Member
I have a calculation field in a report with an IIF statement at the end of each group level, (grouping by date)

=IIf([STAGE_STAT_CD]="PROC",([CountOfREF_NUM]/[TOTAL]),"0.00%")

This is only working if the last record in the group meets the criteria (status = "PROC")

If any other status is listed as the last record the value is the default of 0.00%. I can't just sort the group ascending or descending because the status PROC isn't the first or last alphabetically.

Does anyone know how to make this work no matter where the status PROC is listed in the grouping?
Apr 4 '07 #1
4 1496
MMcCarthy
14,534 Recognized Expert Moderator MVP
I think you have a problem with your logic here. If this calculated field is in the details section it would work for each record. However if it is in the group footer it needs to preform calculation on all appropriate records and this would require some kind of aggregate function. You could try something like this.


Expand|Select|Wrap|Line Numbers
  1.  =Sum(IIf([STAGE_STAT_CD]="PROC",([CountOfREF_NUM]/[TOTAL]),0))
  2.  
Mary
Apr 4 '07 #2
Mj~
4 New Member
Believe me, I am constantly questioning my logic. :o)

The function is in the group footer, and originally I started out with an aggregate function in front but kept getting syntax errors. The expression I originally typed was my first breakthrough. I will keep trying, but appreciate any feedback and ideas.

Thanks for your help!

Mj~
Apr 5 '07 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
Believe me, I am constantly questioning my logic. :o)

The function is in the group footer, and originally I started out with an aggregate function in front but kept getting syntax errors. The expression I originally typed was my first breakthrough. I will keep trying, but appreciate any feedback and ideas.

Thanks for your help!

Mj~
If you're getting syntax errors post your code and we'll have a look.

Mary
Apr 6 '07 #4
Mj~
4 New Member
If you're getting syntax errors post your code and we'll have a look.

Mary
I think I figured it out, I needed a Domain Aggregate function. It works just fine now. Thanks for setting me in the right direction and for your willingness to help out!

This is what i ended up doing:

=DSum("[CountOfREF_NUM]","[qryPercentProcessed]","[STAGE_STAT_CD]='PROC'")

Then I just take that data to figure out the percentage I was looking for.

Thanks again!

Mj~
Apr 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
10325
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
1
17620
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
2315
by: Grim Reaper | last post by:
I know this is probably an easy question, but I could not find/figure it out. Basically, I am printing mailing labels with a "Sorting/Grouping" section that groups the label types together....
3
12093
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
1
2500
by: Megan | last post by:
quick summary: i'm having problems trying to group fields in a report in order to calculate percentages. to calculate percentages, i'm comparing the results from my grouped fields to the totals....
5
3687
by: Tony Williams | last post by:
I have a table "tblmaintabs" that stores data that is collected from various companies on a quarterly basis in March, June, September and December each year (these dates are stored in a Date/time...
7
2164
by: Hank | last post by:
I have a report-summing problem using Access 2000. When a section runs over the end of the page, sometimes a detail gets picked up twice. Example: Customer Header XYZ Company Detail Section...
7
3639
by: Sunil Korah | last post by:
Hi, I haven't used access reports much. I have a problem in getting the total of a group. I have 3 fields, ProgName (Program name), Pname (Participant's name) and PCategory (Participant...
3
3008
by: weirdguy | last post by:
Hello, I need advise on how to solve this scenario. I am not sure whether I should use any Report Application such as Crystal Report or I can just simply use datagridview. My scenario: In a...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.