ADP Report Aggregate Function not allowed

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
CrxfrdAsked:
Who is Participating?
 
Vadim RappConnect With a Mentor Commented:
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
 
Vadim RappCommented:
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
 
CrxfrdAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Vadim RappCommented:
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
 
CrxfrdAuthor Commented:
I have already tried that approach with the format =Sum([txtJobCount1]) and I get an invalid column name error.
0
 
Vadim RappCommented:
Please proceed to the last paragraph of my previous comment. Maybe remove the square brackets, to begin with.
0
All Courses

From novice to tech pro — start learning today.