This is what I have and I receive error - Argument not specified for parameter ‘FalsePart’ of Public Funtion IIF(Expression as Boolean, TruePart As Object, FalsePart As Object) As Object
What I have right now:
=IIF(Fields!RcvDtl_ReceiptDate.Value < Today() AND Fields!PORel_DueDate.Value < Today(), DateDiff(DateInterval.Day,today(),Fields!PORel_DueDate.Value),
IIF(Fields!RcvDtl_ReceiptDate.Value < Today() AND Fields!PORel_DueDate.Value >= Today(), 0,
IIF(Fields!RcvDtl_ReceiptDate.Value >= Today() AND Fields!RcvDtl_ReceiptDate.Value > Fields!PORel_DueDate.Value,
DateDiff(DateInterval.Day, Fields!RcvDtl_ReceiptDate.Value, Fields!PORel_DueDate.Value),
IIF(Fields!RcvDtl_ReceiptDate.Value >= Today() AND Fields!RcvDtl_ReceiptDate.Value <= Fields!PORel_DueDate.Value),
0, 20000))))
When the nested if’s get so complex you have to de construct them and put them together piece by piece. At a glance I can’t see what’s wrong, but I would cut everything out except the first part, make sure that works and then slowly build it out, testing each path every time.
Remove the parenthesis at the end of this line:
IIF(Fields!RcvDtl_ReceiptDate.Value >= Today() AND Fields!RcvDtl_ReceiptDate.Value <= Fields!PORel_DueDate.Value),