Help with an expression (1 Viewer)

Battlescar

New member
Local time
Today, 15:06
Joined
Nov 19, 2017
Messages
3
Is there something I am doing wrong with this expression? I keep getting an error. It is writing in a text box record source on a form.
The data is coming from an query.

=Count(IIf([FiscalYear]=[cboFY].[column](0),0)+IIf([FY]="D",0)+IIf([FundingStatus]="P",0)+IIf([kick off date]=[cboFY].[column](4),0))+Count(IIf([FiscalYear]=[cboFY].[column](3),0)+IIf([FY]="D",0)+IIf([FundingStatus]="P",0)+IIf([kick off date]=([cboFY].[column](0)),0))
 

llkhoutx

Registered User.
Local time
Today, 14:06
Joined
Feb 26, 2001
Messages
4,018
I think that any null value will kill your calculation.

To debug the calculation, put each iif component is a separate column in your (select) query and check for valid results. Each iif might have to be enclosed in an IsError function.
 

isladogs

MVP / VIP
Local time
Today, 20:06
Joined
Jan 14, 2017
Messages
18,209
Multiple IIf statements are a nightmare to manage or bug fix.
If you later want to add to it or modify it, its even harder work.

I expect its difficult for you to read & you (hopefully) know what it means.
For anyone else its almost impossible to follow - suggest you find a different way of achieving the same thing
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:06
Joined
May 7, 2009
Messages
19,231
first, Iif() functions requires three parameters:


Iif(Expression, TrueValue, FalseValue)


you have only the TrueValue there.


second, what is the plus (+) sign there, are you ANDing the expression?
 

Users who are viewing this thread

Top Bottom