Reputation: 135
I need to add a default date value to a parameter in report builder 3.0 If today is monday then extract 3 day else extract 1 day. I have made an example in vb that works
If Weekday(Now(), vbMonday) = 1 Then
TextBox2.Text = DateAdd("d", -3, Today())
Else
TextBox2.Text = DateAdd("d", -1, Today())
End If
Now i want to do it in report builder, i tried following
=IFF (Weekday(Now(), vbMonday) = 1,DateAdd("d", -3, Today()), IFF(Weekday(Now(), vbMonday) != 1, DateAdd("d", -1, Today()))
I am not familiar with the syntax in report builder when using if then else. can someone give me an example.
Upvotes: 1
Views: 1586
Reputation: 14108
Try this:
=IIF(WeekDay(Now(),VbMonday)=1,
DateAdd("d", -3, Today()),
DateAdd("d", -1, Today())
)
You are using an unnecessary nested IIF to evaluate the false part of the outer IIF.
Upvotes: 2