1
votes

IIf (day(now().... in rdlc expression shows error.

I am using visual studio 2014..

here is my code:

=iff( day(now()) >= 1 AND day(now()) <=7, MonthName(month(dateadd("m",-1, Fields!MONTH.Value)),false), MonthName(month(Fields!MONTH.Value),false)))

here is the problem:

Error 1 The Value expression for the textrun ‘MONTH.Paragraphs[0].TextRuns[0]’ contains an error: [BC30451] 'iff' is not declared. It may be inaccessible due to its protection level. C:\Users\Anil\Documents\Visual Studio 2013\Projects\SyllRepo\SyllRepo\Report2.rdlc SyllRepo

2

2 Answers

2
votes

Should be iif instead of iff:

=iif( day(now()) >= 1 AND day(now()) <=7, MonthName(month(dateadd("m",-1, Fields!MONTH.Value)),false), MonthName(month(Fields!MONTH.Value),false)))
2
votes

To fix the error I have added the following Namespace to my file

Imports Microsoft.VisualBasic