Solved

ADP Report Aggregate Function not allowed

Posted on 2008-10-09
6
1,041 Views
Last Modified: 2013-12-05
Thank you for looking at my question,

I have a working report in an Access database that groups data by Week, Date and Shift. I have tried to translate this same format to and Access ADP report but the aggregate functions that work in the access report don't work in the ADP report.

An example of one of the aggregate functions is:

=Sum(IIf([ShiftNo]=1,[JobCount],0)) - this is placed in the control source of a textbox in the report
counts the number of jobs started by Shift1 in a week

The error message I get is:
Aggregate functions are only allowed on output fields of the Record Source

I tried using a CASE statement:
=Sum(CASE WHEN [ShiftNo]=1,[JobCount])

but am told that the expression I have entered contains incorrect syntax.

How do I translate / re write the aggregate function such that it performs dynamic calculation in the adp report.

Thank you
0
Comment
Question by:Crxfrd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22677622
see http://support.microsoft.com/kb/225992

If the field where you want the calculation is not in the footer, then aggregate in the datasource of the report, o: return already calculated value:

select ..., case when shiftno=1 then jobcount else 0 end as Shift1Jobs, .....
0
 

Author Comment

by:Crxfrd
ID: 22677759
vadimrapp1:

I read that article and to me it suggested that i needed to carry out the calculation in the report footer and then refernce the container in the control source in the week footer. Still get the same error messages
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22679541
the article says that in the detail section you put the field that calculates the value without the aggregation, and then in the footer you have a field that sums the field in the detail section.

detail ---------------------
field c1 with controlsource =iif(shiftno=1,jobcount,0)

footer --------------------
field c2 with controlsource =sum(c1)


if it still does not work, I suggest that you create a sample adp exactly as in the article, linked to some trivial table in the database; make sure it works, then see what's different with yours. If sample still does not work, you can upload it to this question.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:Crxfrd
ID: 22684931
I have already tried that approach with the format =Sum([txtJobCount1]) and I get an invalid column name error.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 22688739
Please proceed to the last paragraph of my previous comment. Maybe remove the square brackets, to begin with.
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 22690387
here's another way: make that new field in Detail section with running sum=yes; and the field in the footer - have it control source =<new field>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

734 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