Solved

ADP Report Aggregate Function not allowed

Posted on 2008-10-09
6
1,047 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

635 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