The Expression Is Typed Incorrectly Or Is Too Complex - Report Calculation Error (1 Viewer)

skoolz

Registered User.
Local time
Yesterday, 16:11
Joined
Jun 26, 2015
Messages
32
Hi All, I need help with the following error I'm getting when I try run a report linked to a query. The query loads and works fine, however on the report I get the above titled error with the following calculated fields in the report. if I delete these fields, the report loads fine.

=Count(IIf([FieldA]=1 And [FieldB]=1,1)
=Count(IIf([FieldA]=2 And [FieldB]=1,1)
=Count(IIf([FieldA]=3 And [FieldB]=1,1)
=Count(IIf([FieldA]=4 And [FieldB]=1,1)

or

=Count(IIf([FieldA]=1 And [FieldB]=1,1,0)
=Count(IIf([FieldA]=2 And [FieldB]=1,1,0)
=Count(IIf([FieldA]=3 And [FieldB]=1,1,0)
=Count(IIf([FieldA]=4 And [FieldB]=1,1,0)

So I assume it's erroring when it comes across a FieldA or FieldB value that do not meet the criteria because when I view the query, FieldA does not have any records with the value 2 or 3.


There are no nulls in either of those fields as all the fields are populated with data... except that [FieldA] only has entries 1 or 4. What's annoying is the same report works when I link it to a similar query with different data, the only difference being that in that other query, the records in it have either of the values 1,2,3 and 4 in [FieldA]

Please help??
 

Minty

AWF VIP
Local time
Today, 00:11
Joined
Jul 26, 2013
Messages
10,371
If you remove the count() from query and do it in the report does it work?
e.g. IIf([FieldA]=1 And [FieldB]=1,1)
 

skoolz

Registered User.
Local time
Yesterday, 16:11
Joined
Jun 26, 2015
Messages
32
Thanks fro the response Minty, The count is not in the query, it's only in the report
 

Minty

AWF VIP
Local time
Today, 00:11
Joined
Jul 26, 2013
Messages
10,371
Are the IIF's in the query or only the report?
 

skoolz

Registered User.
Local time
Yesterday, 16:11
Joined
Jun 26, 2015
Messages
32
The IIFs and Counts are in the report only.... the query runs ok and has no calculations in it. It's the report that has these extra calculating fields I created and these are the problem...
 

Minty

AWF VIP
Local time
Today, 00:11
Joined
Jul 26, 2013
Messages
10,371
Do the IIf's in the query then the counts in the report - I suspect that will fix things.
 

Users who are viewing this thread

Top Bottom